start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env python | |
# | |
# Mersenne Twister predictor | |
# | |
# Feed this program the output of any 32-bit MT19937 Mersenne Twister and | |
# after seeing 624 values it will correctly predict the rest. | |
# | |
# The values may come from any point in the sequence -- the program does not | |
# need to see the first 624 values, just *any* 624 consecutive values. The | |
# seed used is also irrelevant, and it will work even if the generator was |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/tejag/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
filetype plugin indent on | |
syntax on | |
set autoread | |
set autowrite | |
set number | |
" Enable mouse | |
set mouse=a |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)Postgres Cheat Sheet | |
Source: Postgresql Documentation | |
### shell commands | |
creatuser <user> | |
deletesuer <user> | |
createdb -O <user> -E utf8 -T <template> <db_name> | |
dropdb <db_name> |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add | |
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" | |
sudo apt install kubeadm |
class Endpoint { | |
constructor(path: String) { | |
} | |
fun query(key: String, defaultValue: String = "", valueExample: String = "", description: String = "") { | |
} | |
} | |
fun post(path: String, func: Endpoint.()->Unit): Endpoint { | |
return Endpoint(path) |
/* Enable postgis */ | |
CREATE EXTENSION IF NOT EXISTS postgis; | |
CREATE TABLE ex1 ( | |
id VARCHAR(10) NOT NULL, | |
loc geography(POINT, 4326) | |
); | |
CREATE INDEX ex1_loc_gix ON ex1 USING GIST (loc); |
import 'package:jaguar/jaguar.dart'; | |
import 'package:jaguar_auth/jaguar_auth.dart'; | |
import 'package:jaguar_example_session_models/jaguar_example_session_models.dart'; | |
main() async { | |
final server = Jaguar(port: 10000); | |
// Register user fetcher | |
server.userFetchers[User] = DummyUserFetcher(users); | |
server.postJson( |