Skip to content

Instantly share code, notes, and snippets.

View edunham's full-sized avatar

E. Dunham edunham

View GitHub Profile
@edunham
edunham / lugbylawsideas
Last active August 29, 2015 14:01
LUG bylaws voting stuff
PR officer position: Recruitment, outreach, social media
Treasurer makes budget and officers vote?
OR
Expenditure cap, over $200/term requires [officer | club] vote
Secretary duty to delegate posting of minutes/slides/video to blog after each talk
Rescinding ops: any time vote of no confidence or resignation, else contact after 4months channel inactivity if no repply 2months after tat, lose hat
/*
SD - a slightly more friendly wrapper for sdfatlib
This library aims to expose a subset of SD card functionality
in the form of a higher level "wrapper" object.
License: GNU General Public License V3
(Because sdfatlib is licensed with this.)
/*
SD - a slightly more friendly wrapper for sdfatlib
This library aims to expose a subset of SD card functionality
in the form of a higher level "wrapper" object.
License: GNU General Public License V3
(Because sdfatlib is licensed with this.)
def bottles(n):
return switch (n) {
match ==0 { return "No bottles" }
match ==1 { return "1 bottle" }
match _ { return `$n bottles` }
}
var n := 99
while (n > 0):
def example(n :int):
var output := ""
switch(n){
match > 0 { output += "less than or equal to zero" }
match == 0 { output += "zero" }
match > -3 { output += "not too small"}
match _ { output += "something else" }
}
return output
def bottles(n):
var foo := ""
switch (n) {
match == 0 { foo += "No bottles" }
match == 1 { foo += "1 bottle" }
#match < 3 { foo += "not many"}
match _ { foo += `$n bottles` }
}
return foo
@edunham
edunham / gist:88a14a8784f331a8c190
Last active August 29, 2015 14:06
neat things
http://dillinger.io/
https://github.com/mongolsamurai/whiskeybot
https://www.vultr.com/register/
http://www.steverrobbins.com/nlpschedule/books.html (nlp reading list)
http://bezier.method.ac/# game where you learn to use the bezier pen
https://github.com/GitbookIO/gitbook Utility for generating books and exercises using GitHub/Git and Markdown
http://imgur.com/gallery/bCiPTU5 how to read Russian, a bit
http://mathyawp.blogspot.com/2013/01/the-lesson-of-grace-in-teaching.html
http://www.mouseless.de/
http://bigtextbox.com/
@edunham
edunham / hello.py
Last active August 29, 2015 14:07
A hello world that uses getopt
#!/usr/bin/env python
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "g:s:", ["given=", "surname="])
except getopt.GetoptError as err:
print str(err) # will print something like "option -a not recognized"
sys.exit(2)
#! /usr/bin/env python
import sys
import os
import datetime
from subprocess import check_output
def count():
files = os.listdir('.')
count = 0
#! /bin/bash
rm -f draft1.html;
cat pre.html >> draft1.html;
for f in {01..27};
do
echo "</pre><a name=\"$f\">" >> draft1.html;
echo "<h1>Chapter $f</h1></a><pre>" >> draft1.html;