Skip to content

Instantly share code, notes, and snippets.

View xeoncross's full-sized avatar

David Pennington xeoncross

View GitHub Profile
@xeoncross
xeoncross / osx_installer.sh
Created April 17, 2021 15:22
Download the full Mac OSX installer image
// 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 April 9, 2021 15:38
Install spaCy on OSX Big Sur

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 April 1, 2021 02:07
Example of using struct enbeding to implement an interface: https://play.golang.org/p/9RAY8RI7_N7
package main
import (
"fmt"
)
type A struct {
B string
}
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 March 12, 2021 15:27 — forked from rrag/.block
CandleStickChart with MACD Indicator
license: MIT
height: 620
@xeoncross
xeoncross / vscode_go_snippets.json
Created January 21, 2021 20:12
VSCode Go snippets
{
// Place your snippets for go here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@xeoncross
xeoncross / YouTubeURLFormats.txt
Created January 16, 2021 03:55 — forked from rodrigoborgesdeoliveira/ActiveYouTubeURLFormats.txt
Example of the various YouTube url formats
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 January 1, 2021 00:07
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
// 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 November 7, 2020 15:58
Remove Ubuntu, Debian, Android, etc... from windows computer
# 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 October 16, 2020 03:00 — forked from tscholl2/aes.go
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"