Skip to content

Instantly share code, notes, and snippets.

@ggmartins
ggmartins / db_to_csv.psql
Created November 13, 2019 19:35
PostgresSQL database to CSV
CREATE OR REPLACE FUNCTION db_to_csv(path TEXT) RETURNS void AS $$
declare
tables RECORD;
statement TEXT;
begin
FOR tables IN
SELECT (table_schema || '.' || table_name) AS schema_table
FROM information_schema.tables t INNER JOIN information_schema.schemata s
ON s.schema_name = t.table_schema
WHERE t.table_schema NOT IN ('pg_catalog', 'information_schema')
@ggmartins
ggmartins / lottery_numbergen.sh
Created May 3, 2019 14:59
Lottery / Megasena Number Generator for python one liners
python3 -c "import random as r,time as t,os;r.seed(t.time);x=[r.randint(1,60) for i in range(6)];x.sort();print(x)"
@ggmartins
ggmartins / golang_on_rpi.md
Last active May 10, 2018 20:25 — forked from konradko/golang_on_rpi.md
Install Golang 1.10.2 on Raspberry Pi
wget https://storage.googleapis.com/golang/go1.10.2.linux-armv6l.tar.gz
sha256sum go1.10.2.linux-armv6l.tar.gz
echo 529a16b531d4561572db6ba9d357215b58a1953437a63e76dc0c597be9e25dd2
sudo tar -C /usr/local -xzf go1.10.2.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin