Skip to content

Instantly share code, notes, and snippets.

@apackeer
apackeer / 0_reuse_code.js
Created June 2, 2014 21:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$ sudo sysctl -w net.inet.ip.forwarding=1
$ sudo natd -interface en1
$ sudo ipfw add divert natd ip from any to any via en1
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@apackeer
apackeer / timestamp.go
Last active August 29, 2015 14:23 — forked from bsphere/timestamp.go
package timestamp
import (
"fmt"
"labix.org/v2/mgo/bson"
"strconv"
"time"
)
type Timestamp time.Time
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | grep -vE "$(docker ps -a --filter='name=-data' -q | tr \"\n\" \|)" | xargs -r docker rm -v
echo "Removing untagged images..."
docker images --no-trunc | grep "<none>" | awk '{print $3}' | xargs -r docker rmi
@apackeer
apackeer / git-unsorted-log.go
Last active August 29, 2015 14:27 — forked from timhughes/git-unsorted-log.go
An example of howto user git2go https://github.com/libgit2/git2go which is a libgit2 bindings package for golang
/*
requires libgit2
*/
package main
import (
@apackeer
apackeer / gist:3796932
Created September 27, 2012 22:52 — forked from kennethreitz/gist:3788842
Top 20 Downloaded Projects on PyPI
Top 20 Downloaded Projects on PyPI
==================================
#1 lxml ........ 4890886 downloads
#2 setuptools .. 4243069 downloads
#3 distribute .. 3880163 downloads
#4 zc.buildout . 3090694 downloads
#5 pip ......... 2695166 downloads
#6 boto ........ 2463436 downloads
#7 simplejson .. 2364527 downloads
@apackeer
apackeer / zsh.md
Created October 1, 2012 07:08 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

and then you change your shell to zsh

chsh -s `which zsh`

and then restart

@apackeer
apackeer / osx_lion_rail_setup.md
Created October 2, 2012 20:14 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL

Setup new Mac with OSX Mountain Lion from scratch

First things first, run a software update...

Install xcode 4

App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.

Install Command Line Tools for Xcode

Downloads for Apple Developers