Most notes have been taken from the book PostgreSQL: Up and Running which I highly recommend. Buy it, loads of little gems inside.
The minimum SQL command to create a database is:
| #!/bin/vbash | |
| # CONFIG | |
| wan=dhcp | |
| lan=192.168.1.1 | |
| lan_segment=192.168.1.0 | |
| vpn_segment=192.168.5.0 | |
| domain=apertoire.org | |
| lease_start=192.168.1.200 | |
| lease_stop=192.168.1.245 |
| // Fetch makes network calls using the method (POST/GET..), the URL // to hit, headers to add (if any), and the body of the request. | |
| // Feel free to add more stuff to before/after making the actual n/w call! | |
| func Fetch(method string, url string, header map[string]string, body io.Reader) (*http.Response, err) { | |
| // Create client with required custom parameters. | |
| // Options: Disable keep-alives, 30sec n/w call timeout. | |
| client := &http.Client{ | |
| Transport: &http.Transport{ | |
| DisableKeepAlives: true, | |
| }, | |
| Timeout: time.Duration(10 * time.Second), |
Most notes have been taken from the book PostgreSQL: Up and Running which I highly recommend. Buy it, loads of little gems inside.
The minimum SQL command to create a database is:
Nice snippet from Stathat:
func timeTrack(start time.Time, name string) {
elapsed := time.Since(start)
log.Printf("%s took %s\n", name, elapsed)
}
func tracked() {| <? | |
| // <readme> | |
| /* | |
| This is a lite version of Olark's and Intercom's functionality (without the chat part). | |
| It lets you get feedback from users on your site to your email. | |
| And you won't have to rely on another company anymore! | |
| #killyourdependencies |
mkdir -p ~/apps/pgadmin4
cd ~/apps/pgadmin4
virtualenv venv -p /usr/bin/python2.7
source ./venv/bin/activate
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.5/pip/pgadmin4-1.5-py2.py3-none-any.whl
pip install six
pip install pgadmin4-1.5-py2.py3-none-any.whl| // License: MIT | |
| package main | |
| import ( | |
| "crypto/rand" | |
| "fmt" | |
| "math/big" | |
| ) | |
| // GenerateRandomASCIIString returns a securely generated random ASCII string. |
| package main | |
| import "fmt" | |
| // State provides the minimal state machine | |
| type State func() (next State) | |
| func tick() State { | |
| fmt.Println("tick...") | |
| return tock |
| # Search directories with name node_modules | |
| find . -name 'node_modules' -type d | |
| # Displays parent folders and child folders | |
| ./laravel/passport/node_modules (parent) | |
| ./laravel/passport/node_modules/yargs-parser/node_modules (child) | |
| ./laravel/passport/node_modules/gauge/node_modules (child) | |
| ./hapi/hapi-auth-jwt2/node_modules (parent) | |
| ./hapi/hapi-auth-jwt2/node_modules/acorn-jsx/node_modules (child) | |
| ./hapi/hapi-auth-jwt2/node_modules/optimist/node_modules (child) |