This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS keys; | |
CREATE TABLE keys ( | |
key_name VARCHAR(128) UNIQUE NOT NULL PRIMARY KEY, | |
context VARCHAR(128) NOT NULL, | |
position INTEGER NOT NULL, | |
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Using script https://github.com/array-analytics/plpg_hashids | |
DROP TABLE fruits; | |
CREATE TABLE fruits ( | |
id SERIAL UNIQUE NOT NULL, | |
hash_id VARCHAR(16) PRIMARY KEY | |
DEFAULT hashids.encode(currval(pg_get_serial_sequence('fruits', 'id')), 'SALT', 16), | |
fruit_name VARCHAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// from: https://stackoverflow.com/questions/27368973/golang-facebook-authentication-using-golang-org-x-oauth2 | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'React'; | |
import { View, Button, Text } from 'react-native'; | |
import { observable, computed, action } from 'mobx'; | |
import { observer } from 'mobx-react'; | |
class _TodosService { | |
i = 1 | |
@observable todos = [ | |
{name: "Test_0", done: false} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/Sirupsen/logrus" | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/postgres" | |
) |
I hereby claim:
- I am albttx on github.
- I am alebatt (https://keybase.io/alebatt) on keybase.
- I have a public key whose fingerprint is 656F E39D 06B0 B77F 7D7B 4DBE 6ECD B1C9 555B CE18
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LFS=/mnt/ft_linux | |
LFS_TGT=$(uname -m)-lfs-linux-gnu | |
SRCS=$LFS/sources | |
ARCHIVES=$SRCS/archives | |
TAR="tar -xvf" | |
LOGFILE=$LFS/install_log.txt | |
################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
zmq "github.com/zeromq/goczmq" | |
) | |
func create_dealer() *zmq.Sock { | |
dealer, err := zmq.NewDealer("tcp://127.0.0.1:7878") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tree | |
attr_reader :data | |
def initialize(data) | |
@data = data | |
end | |
def +(other) | |
Tree.new(deep_merge(@data, other.is_a?(Tree) ? other.data : other)) | |
end |