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 |
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")))) |
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 |
View aes.go
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"crypto/sha256" | |
"encoding/hex" | |
"fmt" | |
"strings" |
View crypto-sha.js
/** | |
* Returns SHA-256 hash from supplied message. | |
* | |
* @param {String} message. | |
* @returns {String} hash as hex string. | |
* | |
* @example | |
* sha256('abc').then(hash => console.log(hash)); | |
* const hash = await sha256('abc'); | |
*/ |
View gist:cdb501a44eacda865b00b4806dcb318a
package main | |
import ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
) | |
// https://pkg.go.dev/go/ast?tab=doc#Object.Type |
View 64bit_hash_collisions_test.go
package main | |
import ( | |
"crypto/sha256" | |
"encoding/hex" | |
"fmt" | |
"hash/fnv" | |
"testing" | |
"time" |
View LSA.py
#!/usr/bin/python | |
# reference => http://www.puffinwarellc.com/index.php/news-and-articles/articles/33.html | |
from numpy import zeros | |
from scipy.linalg import svd | |
from math import log # needed for TFIDF | |
from numpy import asarray, sum | |
titles = ["The Neatest Little Guide to Stock Market Investing", |
View crypto_news.json
[ | |
{ | |
"url": "http://money.cnn.com", | |
"rss": "http://rss.cnn.com/rss/money_topstories.rss" | |
}, | |
{ | |
"url": "http://thehill.com", | |
"rss": "http://thehill.com/rss/syndicator/19110" | |
}, | |
{ |
View mysql.py
import mysql.connector | |
# from mysql.connector import Error | |
# pip3 install mysql-connector | |
# https://dev.mysql.com/doc/connector-python/en/connector-python-reference.html | |
class DB(): | |
def __init__(self, config): | |
self.connection = None | |
self.connection = mysql.connector.connect(**config) |
NewerOlder