Skip to content

Instantly share code, notes, and snippets.

View johannesboyne's full-sized avatar
👨‍💻
Building.

Johannes Boyne johannesboyne

👨‍💻
Building.
View GitHub Profile
wget http://xivilization.net/~marek/raspbian/xivilization-raspbian.gpg.key -O - | sudo apt-key add -
sudo wget http://xivilization.net/~marek/raspbian/xivilization-raspbian.list -O /etc/apt/sources.list.d/xivilization-raspbian.list
sudo aptitude update
sudo aptitude install golang
# apt-get install devscripts build-essential
# apt-get build-dep golang-go
wget http://ftp.de.debian.org/debian/pool/main/g/golang/golang_1.3-1.dsc
wget http://ftp.de.debian.org/debian/pool/main/g/golang/golang_1.3.orig.tar.gz
wget http://ftp.de.debian.org/debian/pool/main/g/golang/golang_1.3-1.debian.tar.xz
dpkg-source -x golang_1.3-1.dsc
cd golang-1.3/
debuild -us -uc
cd ..
var gulp = require('gulp')
var through = require('through')
var clone = require('clone')
var Buffer = require('buffer').Buffer
var gutil = require('gulp-util')
var spawn = require('child_process').spawn
// Compile Haml into HTML
gulp.task('haml', function() {
var files = []
@johannesboyne
johannesboyne / fig.yml
Created November 4, 2014 06:46
fig.yml for ruby on rails and postgres
db:
image: postgres
ports:
- "5432"
app:
build: .
environment:
RAILS_ENV: development
ports:
- "3000:3000"
@johannesboyne
johannesboyne / Dockerfile
Created November 4, 2014 06:46
Dockerfile for ruby on rails and postgres
FROM rails:onbuild
# Disable bundle freeze so we can install additional gems
RUN bundle config --global frozen 0
@johannesboyne
johannesboyne / greyscale.sh
Created September 2, 2014 14:29
Greyscale Video
ffmpeg -ss 00:00:00.000 -i IMG_3025.MOV -vf "boxblur=4:2,mp=eq2=1:1:0.12:0.0:1:1:1" -an -s 960x540 -t 00:00:10.000 outpu2t.mp4
@johannesboyne
johannesboyne / js_inheritance.js
Last active August 29, 2015 14:05
JS Inheritance
// this
var o = new Foo();
// equals this
var o = new Object();
o.[[Prototype]] = Foo.prototype; // we cannot call [[Prototype]]
Foo.call(o);
// its recursive
Object.getPrototypeOf(o).someProp
// and then if not exists
package main
import (
"os"
"bufio"
)
func main() {
scanner := bufio.NewScanner(bufio.NewReader(os.Stdin))
for scanner.Scan() {
@johannesboyne
johannesboyne / sort-uniq-awk-sort-sed.go
Created July 10, 2014 07:25
sort | uniq -c | awk '{ x[$2] += $1 } END { for (w in x) { print x[w] " " w } }' | sort -rn | sed 20q in go
package main
import (
"os"
"bufio"
"fmt"
"sort"
"math"
)
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;