Skip to content

Instantly share code, notes, and snippets.

@m-butterfield
m-butterfield / genetic_algorithm.py
Last active December 9, 2018 02:26
Genetic Algorithm
"""
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
"""
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
@m-butterfield
m-butterfield / dumb
Last active September 16, 2015 02:39
#!/usr/bin/env python
"""
dumb
this is pretty dumb
Usage:
dumb <file_name>
Options:
#!/usr/bin/env python
"""
top_history
Print the top 10 commands from your bash history
Usage:
top_history <user_name>
Options:
@m-butterfield
m-butterfield / hipchatter
Last active March 29, 2018 18:12
hipchatter
#!/usr/bin/env python3
"""
hipchatter
Import ALL THE EMOJI (allthethings) from Hipchat into Slack!
Usage:
hipchatter <slack-team> <slack-cookie>
Options:
"""
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'),
@m-butterfield
m-butterfield / getimagedimensions.go
Created January 26, 2017 04:05
getimagedimensions.go
package main
import (
"database/sql"
"flag"
"image"
_ "image/jpeg"
_ "image/png"
"io/ioutil"
"log"
@m-butterfield
m-butterfield / binary_search.go
Created January 27, 2017 15:46
binary search in go
package main
import (
"fmt"
"sort"
)
type Thingy struct {
Woop int
}