Skip to content

Instantly share code, notes, and snippets.

Avatar

David Pennington Xeoncross

View GitHub Profile
@Xeoncross
Xeoncross / settings.json
Created Apr 22, 2021
Changes to https://github.com/tonsky/vscode-theme-alabaster Alabaster theme to make more text black
View settings.json
{
"editor.formatOnSave": true,
"workbench.colorTheme": "Alabaster",
"editor.tokenColorCustomizations": {
"[Alabaster]": {
"textMateRules": [{
"scope": "support.class",
"settings": {
"foreground": "#000"
}
@Xeoncross
Xeoncross / osx_installer.sh
Created Apr 17, 2021
Download the full Mac OSX installer image
View osx_installer.sh
// https://eclecticlight.co/2019/10/18/beware-apple-security-certificates-after-24-october-they-may-have-expired/
// the macOS 10.15 version of the softwareupdate command tool contains a new option which allows you to download full installers for specific versions of macOS
// Get Mojave
softwareupdate --fetch-full-installer --full-installer-version 10.14.6
@Xeoncross
Xeoncross / spacy_on_big_sur.md
Created Apr 9, 2021
Install spaCy on OSX Big Sur
View spacy_on_big_sur.md

spaCy on Mac Big Sur

Mac OSX ships with python (2) and python3 with pip3.

They should be current enough versions. If not, you can update them.

pip3 install -U pip3 setuptools

First install spaCy

@Xeoncross
Xeoncross / struct_embedding.go
Last active Apr 1, 2021
Example of using struct enbeding to implement an interface: https://play.golang.org/p/9RAY8RI7_N7
View struct_embedding.go
package main
import (
"fmt"
)
type A struct {
B string
}
View indicators.js
const LONG = 26;
const SHORT = 12;
const MID = 9;
function sum(inputs) {
return inputs.reduce((s, v) => s + v, 0);
}
function average(N, inputs) {
return sum(inputs.slice(0, N)) / N;
@Xeoncross
Xeoncross / .block
Created Mar 12, 2021 — forked from rrag/.block
CandleStickChart with MACD Indicator
View .block
license: MIT
height: 620
@Xeoncross
Xeoncross / YouTubeURLFormats.txt
Created Jan 16, 2021 — forked from rodrigoborgesdeoliveira/YouTubeURLFormats.txt
Example of the various YouTube url formats
View YouTubeURLFormats.txt
http://www.youtube.com/watch?v=-wtIMTCHWuI
http://www.youtube.com/v/-wtIMTCHWuI?version=3&autohide=1
http://youtu.be/-wtIMTCHWuI
http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3D-wtIMTCHWuI&format=json
http://www.youtube.com/attribution_link?a=JdfC0C9V6ZI&u=%2Fwatch%3Fv%3DEhxJLojIE_o%26feature%3Dshare
@Xeoncross
Xeoncross / static_server.go
Last active Jan 1, 2021
Example of using httprouter or gorilla/mux to serve static assets (JS, Images, CSS, etc..) cached in the app binary using github.com/markbates/pkger
View static_server.go
// https://github.com/julienschmidt/httprouter
router := httprouter.New()
router.HandlerFunc("GET", "/", index())
router.Handler("GET", "/static/*filepath", http.StripPrefix("/static/", http.FileServer(pkger.Dir("/public/static"))))
// https://github.com/gorilla/mux
router := mux.NewRouter()
router.HandleFunc("/", index())
router.PathPrefix("/static").Handler(http.StripPrefix("/static/", http.FileServer(pkger.Dir("/public/static"))))
@Xeoncross
Xeoncross / remove_ubuntu.sh
Created Nov 7, 2020
Remove Ubuntu, Debian, Android, etc... from windows computer
View remove_ubuntu.sh
# You can do this using cmd run as administrator from the desktop
# (or if using a Windows 10 S-Mode computer from the startup repair or a USB drive).
$ diskpart
> list vol
# Find the Fat32, 100MB/260MB EFI volume and select it:
> select volume 3
> assign letter=z
> exit
@Xeoncross
Xeoncross / aes.go
Created Oct 16, 2020 — forked from tscholl2/aes.go
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
View aes.go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"