Skip to content

Instantly share code, notes, and snippets.

View robertseaton's full-sized avatar

robert seaton robertseaton

View GitHub Profile
@robertseaton
robertseaton / gist:951e770c9df1654dd5ee
Created June 10, 2014 19:42
Boston marathon data
Year Entrants
2014 35671
2013 26839
2012 26839
2011 26907
2010 26735
2009 23315
2008 22411
2007 20763
2006 20089
@robertseaton
robertseaton / gist:2596287
Created May 4, 2012 17:10
squared 2d noise grid w/ len-based fill
(ns art.core
(:use quil.core
[quil.helpers.seqs :only [range-incl]]
[quil.helpers.calc :only [mul-add]]))
(defn to-color-range
[n]
(mod (* 255 n) 255))
(defn draw-point
@robertseaton
robertseaton / gist:2596271
Created May 4, 2012 17:07
squared 2d noise grid w/ random fill (grey)
(ns art.core
(:use quil.core
[quil.helpers.seqs :only [range-incl]]
[quil.helpers.calc :only [mul-add]]))
(defn to-color-range
[n]
(mod (* 255 n) 255))
(defn draw-point
@robertseaton
robertseaton / .zshrc
Created April 16, 2012 20:56 — forked from colegleason/.zshrc
davesdots meets robbseaton-current
# .zshrc mashup of davesdots and robbseaton
# "compile slow, run fast." - family motto
export CFLAGS="-O3 -funsafe-loop-optimizations -ffast-math -march=native -pipe"
export CXXFLAGS=${CFLAGS}
# export LDFLAGS=${CFLAGS}
# I think I speak for everyone when I say "fuck gcc"
alias cc="clang -Wall -Wextra -Werror"
@robertseaton
robertseaton / gist:2140485
Created March 20, 2012 19:48
computers are fast
/* when in doubt,
use brute force */
int l, k;
long long inversions = 0;
for (l = 0; l < 100000; l++)
for (k = l; k < 100000; k++)
if (j[l] > j[k])
inversions++;
#include <stdio.h>
int main() {
int kwh, cust, i;
kwh = cust = -1;
if (kwh && cust != -1)
printf("golly, zach's pretentious explanation is accurate.\n");
else
@robertseaton
robertseaton / hashmap.c
Created September 13, 2011 18:27 — forked from colegleason/hashmap.c
Hashmap
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_KEY 50
#define MAX_HASH 10
struct node {
char key[MAX_KEY];
int value;
CFLAGS="-O2 -pipe -march=native"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
GENTOO_MIRRORS="ftp://mirror.mcs.anl.gov/pub/gentoo/"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
VIDEO_CARDS="fglrx"
INPUT_DEVICES="evdev"
ACCEPT_LICENSES="*"
ACCEPT_KEYWORDS="~amd64"
MAKEOPTS="-j4"
@robertseaton
robertseaton / gist:923157
Created April 16, 2011 14:43
Fontconfig Configuration
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
</match>
@robertseaton
robertseaton / gist:923156
Created April 16, 2011 14:40
rtorrent Configuration
scgi_port = 127.0.0.1:5000
max_uploads = 10
download_rate = 1200
upload_rate = 200
directory = /home/robb/torrents/working
schedule = watch_directory,5,5,load_start=/home/robb/downloads/*.torrent
use_udp_trackers = yes