Skip to content

Instantly share code, notes, and snippets.

View binary_search.go
package main
import (
"fmt"
"sort"
)
type Thingy struct {
Woop int
}
View getimagedimensions.go
package main
import (
"database/sql"
"flag"
"image"
_ "image/jpeg"
_ "image/png"
"io/ioutil"
"log"
View multiproc.py
"""
Run N number of processes at once
"""
from itertools import izip_longest
from multiprocessing import Process
import time
DATA = (('a', '2'), ('b', '4'), ('c', '6'), ('d', '8'),
View hipchatter
#!/usr/bin/env python3
"""
hipchatter
Import ALL THE EMOJI (allthethings) from Hipchat into Slack!
Usage:
hipchatter <slack-team> <slack-cookie>
Options:
View top_history
#!/usr/bin/env python
"""
top_history
Print the top 10 commands from your bash history
Usage:
top_history <user_name>
Options:
View dumb
#!/usr/bin/env python
"""
dumb
this is pretty dumb
Usage:
dumb <file_name>
Options:
View knapsack.py
"""
My Python spin on this:
http://burakkanber.com/blog/machine-learning-genetic-algorithms-in-javascript-part-2/
"""
import math
import random
import sys
from copy import copy
from optparse import OptionParser
View genetic_algorithm.py
"""
My Python spin on this:
http://burakkanber.com/blog/machine-learning-genetic-algorithms-part-1-javascript/
"""
from optparse import OptionParser
import random
import string
import sys
import time