Skip to content

Instantly share code, notes, and snippets.

View lonnen's full-sized avatar
:shipit:

Lonnen lonnen

:shipit:
View GitHub Profile
@lonnen
lonnen / hammingGenerator.py
Created February 1, 2011 22:35
As far as I can tell, this is voodoo.
#!/usr/bin/env python
'''
Generate the nth member of the Hamming sequence (the set of 5-smooth numbers)
This is made possible by lazy sequence generation. I stole most of it from
http://svn.python.org/projects/python/trunk/Lib/test/test_generators.py
naturally, it makes heavy use of generator functions.
usage python hammingGenerator.py # -v
# is the nth number
@lonnen
lonnen / gist:862664
Created March 9, 2011 18:11
zztr @ 3:10 - "is there a way to turn the mouse invisible and just process delta mouse info?"
// there are lots of other methods and events related to the mouse you can use
// in addition to the below mouseMoved(). You can also use the four variables
// below, which contain mouse information from the last mouse event.
// these are all in the input : http://processingjs.org/reference
void setup() {
noCursor(); // hides the mouse
}
@lonnen
lonnen / logz.txt
Created June 20, 2011 21:41
#Processing irc partial log from 04 - 25 - 11
The topic for #processing is: P5 - processing.org - [Algorithmic Art] / [Generative Art] / [Art from Code] / [Design Interfaces] (10:21:20 AM)
cardamon [~mute@wn-0-22-43-57-13-41.wifi.gsu.edu] entered the room. (10:23:15 AM)
atrowbri left the room (quit: Quit: atrowbri). (10:24:18 AM)
10:32:49 AM abielins: \o
10:33:20 AM lonnen: clever
10:33:32 AM lonnen: aberry: just throw out the questions
10:33:40 AM lonnen: er.. abielins just throw out the question
10:33:55 AM aberry: OK
10:34:46 AM abielins: lonnen: What is the air speed velocity of an unladen swallow?
10:34:49 AM aberry: how can i get my manager to let me work on processing projects at my day job? :D
@lonnen
lonnen / update_vim.sh
Created July 17, 2011 21:14
Get a more recent vim running in your terminal
# you'll need mercurial, gzip, a c compiler...
# though you could skip the mercurial if you download the source directly
# get the latest source checkout
hg clone https://vim.googlecode.com/hg/ vim
cd vim
# if you already have the source, make sure it is up to date
## cd path/to/vim
## hg pull
@lonnen
lonnen / newtcbs.py
Created August 4, 2011 23:05 — forked from rhelmer/newtcbs.py
newtcbs
#!/usr/bin/python
import logging
from datetime import datetime
from datetime import timedelta
logger = logging.getLogger("duplicates")
import socorro.lib.psycopghelper as psy
import socorro.lib.util as util
@lonnen
lonnen / newtcbs.py
Created August 5, 2011 17:31 — forked from rhelmer/newtcbs.py
newtcbs
#!/usr/bin/python
import logging, sys
logger = logging.getLogger("duplicates")
import socorro.lib.psycopghelper as psy
import socorro.lib.util as util
def update(config, targetDate):
@lonnen
lonnen / index.html
Created September 6, 2011 17:27
Prototype using a stacked bar chart to represent crashes by builds.
<!DOCTYPE html>
<html>
<head>
<title>Crashes</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.csv.js?1.29.1"></script>
<style type="text/css">
@lonnen
lonnen / alert_page_styles.js
Created September 28, 2011 02:15
alerts all the css tokens in stylesheets attached to the page as a list, then as a set
/*
Lists all the css tokens in stylesheets attached to the page.
h1 {}
.someClass h2{}
#h3 {}
.someClass h3{}
would be:
tokens: h1, .someClass, h2, #h3, .someClass, h3
@lonnen
lonnen / author_stats.sh
Created November 10, 2011 00:25
Git repo summary stats for a particular author
git log --shortstat --author "AUTHOR NAME" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed: ", files, "\nlines inserted: ", inserted, "\nlines deleted: ", deleted}'
@lonnen
lonnen / newreport.php
Created November 10, 2011 20:05
Barebones Report
<?php
class NewReport_Model extends Model {
public function getNewReportViaWebService() {
}
}
?>