Skip to content

Instantly share code, notes, and snippets.

View jeremyBanks's full-sized avatar

Jeremy Banks jeremyBanks

  • Canada
  • 12:33 (UTC -04:00)
View GitHub Profile
@jeremyBanks
jeremyBanks / computer.txt
Created October 6, 2009 20:16
[2010-01] old thoughts on a cheap system
http://arstechnica.com/hardware/guides/2009/04/ars-technica-system-guide-april-2009-edition.ars
Asus M3A78-EM Motherboard - 80$
AMD Athlon 64 X2 [TBD] Processor - 80$ (http://www.tigerdirect.com/applications/category/category_slc.asp?Recs=10&Nav=|c:2328|&Sort=2)
4GB DDR2 800MHz RAM - 40$
[TBD] Case - $80
Pass on video for now.
@jeremyBanks
jeremyBanks / marijuana.css
Created October 15, 2009 07:20
[2010-01] old lame style for trees-themed subreddits
We couldn’t find that file to show.
@jeremyBanks
jeremyBanks / gist:214737
Created October 21, 2009 00:21
[2010-01] rambling in my head on what a python could do
_Sorry if this is poorly-articulated, I'm a bit drowsy at the moment._
I know that Python is supposed to have an easy-to-read syntax, and appreciate
that allowing too much flexibility could have some effect on that. I don't see this as a replacement for Python's syntax, just as an alternative, maybe a fork or an interpreter flag.
I like Python's syntax, but would like it to be more flexible. Using ideas
from other languages, here's the approach I was thinking of.
Looking at a simple function decoration:
@jeremyBanks
jeremyBanks / python_proposal.md
Created October 22, 2009 15:59
draft summary of some changes I dream of seeing in Python

Work in progress.

All names, identifiers and interfaces outlined in this document may be seen as placeholders, the functionality they provide is the important part.

Python is a wonderful language, but its metaprogramming facilities are limited and can lead to unnecessary verbosity. This document proposes a set of backward compatible changes which would allow developers more flexibility.

@jeremyBanks
jeremyBanks / git-graph.py
Created November 7, 2009 15:08
Shitty little script that spits out a Google chart of activity in a repo over time
#!/usr/bin/env python3.1
"""Shitty little script that spits out a Google chart of activity in a repo over time"""
import sys
import subprocess
import re
import collections
import itertools
import datetime
WHITESPACE = re.compile("[ \t\n\r]+")
@jeremyBanks
jeremyBanks / README
Created January 4, 2010 09:21
trying some simple simulations from The Selfish Gene
author: Jeremy Banks <[email protected]>
license: MIT (do what you want but give attribution)
I'm currently reading The Selfish Gene by Richard Dawkins. On page 185
(of ISBN 9780199291151) he mentions a computer simulation he ran to
test a theory. It sounded interesting and not too complicated, so I
decided to attempt to replicate it.
Currently, I am failing rather badly.
@jeremyBanks
jeremyBanks / scifidea.md
Created April 28, 2010 05:11
sci-fi idea node

A galaxy-spanning post-singularity civalization (perhaps descending from us, perahps not) as the heat death of their univese approaches. They know that the cosmological natural selection theory (in which black holes create new universes with physical constants mutated slightly from our own) is correct. They intend to escape our universe through a black hole into a new universe using some contrived technology. Biological life wouild certainly be killed by any significant change in the fundemental constants of the universe, however if the right constants were modified singificantly little it may be possible for certain elements to keep properties close enough to those they have in our univese that it may be possible to build devices that could function in both. This is a lifeline for the civilization, as they've long since abandoned their physical bodies. Perhaps due to a correlation between the mass of the black hole and the size of the resultant uni

@jeremyBanks
jeremyBanks / expanded.md
Created June 22, 2010 05:10
one-line self-executing c header and expanded explanation
//

Since we don't want this visible in C, we put it in a comment.

&>/dev/null

Unfortunately // is interpreted as an invalid shell command and produces an error message, so we need to redirect that to /dev/null to get rid of it.

;x="${0%.*}"
http://www.utoronto.ca/TCard/when.html
http://www.uc.utoronto.ca/content/view/5/1249/
#!/usr/bin/env python3.1
import sys, collections, re, json
Post = collections.namedtuple("Post", "postid _ _ username userid title _ content _ _ _ _ _ _ _ _ _ _", rename=True)
raw = sys.stdin.read()
raw = re.sub(r"\\(!\\)", "", raw)
raw_posts = raw.replace("\r\n", "\r").split("\n")
posts = [ eval("Post({})".format(raw_post.replace("\r", "\n").replace("'", "'''"))) for raw_post in raw_posts if raw_post ]