Skip to content

Instantly share code, notes, and snippets.

@gopperman
gopperman / gist:18cb66078372d3261420829630230b80
Created October 27, 2017 15:13
Install postgis-2.3.2 with postgres@9.6
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/aa049a47b218fda30f9a4a454119ae067a02cf50/Formula/postgis.rb
#pg_config --pkglibdir is useful for finding your $libdir
cp -a /usr/local/share/postgresql/extension/postgis* /usr/local/Cellar/postgresql@9.6/9.6.5/share/postgresql@9.6/extension/
cp -a /usr/local/lib/postgresql/postgis-2.3.so /usr/local/Cellar/postgresql@9.6/9.6.5/lib/postgis-2.3
cp -a /usr/local/lib/postgresql/rtpostgis-2.3.so /usr/local/Cellar/postgresql@9.6/9.6.5/lib/

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@jinzhu
jinzhu / main.go
Created October 1, 2015 00:07
handle postgres json with gorm
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
func main() {
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
@bg5sbk
bg5sbk / tcp_bench.go
Last active November 22, 2023 18:31
tcp benchmark for echo servers
package main
import (
"flag"
"fmt"
"log"
"net"
"sync"
"sync/atomic"
"time"
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active February 25, 2024 13:47
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@greatghoul
greatghoul / group_sum.py
Created November 15, 2012 14:24
SqlAlchemy Group By
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from sqlalchemy import create_engine, Column, Integer, String, func
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class StudentInfo(Base):
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 16, 2024 14:02
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname