- start restful api server
postgrest "host=localhost dbname=tnews" -a $(whoami) --schema public
- serve the html
python -m SimpleHTTPServer 8080
| # $ jupyter notebook | |
| # Right top, click New | |
| # https://www.dataquest.io/blog/jupyter-notebook-tutorial/ | |
| # https://www.kaggle.com/janiobachmann/lending-club-risk-analysis-and-metrics |
| # Download youtube to mp3 | |
| youtube-dl -f bestaudio -x --audio-format mp3 -o '%(playlist)s/%(playlist_index)s – %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLByf7LdMdgugN_3Jms9fjJpNV6rS_eB2N | |
| # Download playlist | |
| youtube-dl -o '%(playlist)s/%(playlist_index)s – %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLByf7LdMdgugN_3Jms9fjJpNV6rS_eB2N | |
| # Cut videos | |
| ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 cut.mp4 | |
| # Download from ustream to mp4 so even partially downloaded data can be used |
| import numpy as np | |
| # logistic regression. | |
| # yi = sigmoid(dot(a * xi)) | |
| def sigmoid(x): | |
| return 1 / (1 + np.exp(-x)) | |
| N = 1000 | |
| M = 2 |
| import numpy as np | |
| # A linear function. | |
| # Ax = y | |
| # Given A and y, solve x. | |
| # Standard L2 loss function with l2 regularization. | |
| N = 1000 | |
| M = 2 | |
| A = np.random.random((N, M)) |
postgrest "host=localhost dbname=tnews" -a $(whoami) --schema public
python -m SimpleHTTPServer 8080
| // Based on tutorial here: | |
| // https://itp.nyu.edu/physcomp/labs/labs-serial-communication/lab-serial-communication-with-node-js/ | |
| // Examples: | |
| // node test.js /dev/tty.Makeblock-ELETSPP | |
| var serialport = require('serialport'); | |
| var SerialPort = serialport.SerialPort; | |
| var portName = process.argv[2]; | |
| // turn led green |
| // https://github.com/google/google-api-go-client | |
| import ( | |
| "golang.org/x/net/context" | |
| "golang.org/x/oauth2/google" | |
| "google.golang.org/api/compute/v1" | |
| ) | |
| func main() { | |
| // Use oauth2.NoContext if there isn't a good context to pass in. |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| execute pathogen#infect() | |
| syntax on | |
| filetype plugin indent on | |
| set number | |
| set backspace=2 | |
| set t_Co=256 | |
| set background=dark | |
| colorscheme PaperColor |
| curl -XPUT 'http://localhost:9200/_template/github-watch' -d @github-watch-mappings.json |