Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab as pl | |
from numpy import fft | |
def fourierExtrapolation(x, n_predict): | |
n = x.size | |
n_harm = 10 # number of harmonics in model | |
t = np.arange(0, n) | |
p = np.polyfit(t, x, 1) # find linear trend in x | |
x_notrend = x - p[0] * t # detrended x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Note: Lines beginning with "REM" or :: are comments | |
:: Script by: https://github.com/thiojoe | |
:: Purpose: Creates a much more user friendly output for the Microsoft Error Lookup Tool (err.exe). It parses the original output and modifies the text. | |
:: Usage: Just call the batch file with command prompt along with the error code the same as you would with err.exe | |
:: Example: error.bat 50 | |
:: Recommended to rename this script to something shorter like 'error.bat'. Must be next to the lookup tool exe file. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tweaked from: https://stackoverflow.com/a/42718113/1170664 | |
func getXML(url string) ([]byte, error) { | |
resp, err := http.Get(url) | |
if err != nil { | |
return []byte{}, fmt.Errorf("GET error: %v", err) | |
} | |
defer resp.Body.Close() | |
if resp.StatusCode != http.StatusOK { | |
return []byte{}, fmt.Errorf("Status error: %v", resp.StatusCode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from celery import Celery | |
from pydantic import BaseModel, TypeAdapter | |
from pydantic_serializer import PydanticCelerySerializer | |
app = Celery("tasks", broker="pyamqp://guest@localhost//", backend="rpc://") | |
class TaskDefinition(BaseModel): | |
x: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
This script will help to address errors such as those below below when trying to build Windows container images with certain verions of SQL Server | |
This occurs with SQL 2016, 2017 as well as SQL 2022 if updates are included in the build | |
This script is specific to SQL 2022 and will extract the needed files from the a CU update without needing to install the update anywhere | |
The files will be packaged in a tar file that can be added to the image build | |
For 2016/2017, WizardFrameworkLite is also required and the missing files can be taken from the installation media | |
#> | |
<# | |
03/16/2023 09:11:46.863 [13296]: Detailed info about C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.NetEnterpriseServers.ExceptionMessageBox.resources\v4.0_16.0.0.0_de_89845dcd8080cc91 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FastLED DemoReel100 for LumosRing by Bradán Lane STUDIO | |
// https://www.tindie.com/products/bradanlane/lumosring-circuitpython-led-ring-block/ | |
#include <FastLED.h> | |
FASTLED_USING_NAMESPACE | |
// FastLED "100-lines-of-code" demo reel, showing just a few | |
// of the kinds of animation patterns you can quickly and easily | |
// compose using FastLED. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
# To use this shell.nix on NixOS your user needs to be configured as such: | |
# users.extraUsers.adisbladis = { | |
# subUidRanges = [{ startUid = 100000; count = 65536; }]; | |
# subGidRanges = [{ startGid = 100000; count = 65536; }]; | |
# }; |
NewerOlder