Skip to content

Instantly share code, notes, and snippets.

View jeremyBanks's full-sized avatar

Jeremy Banks jeremyBanks

  • Canada
  • 18:51 (UTC -04:00)
View GitHub Profile
@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%.*}"
@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 / 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 / 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 / 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 / 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 / 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 / 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 / gist:186509
Created September 14, 2009 04:57
[2010-01] this might have been speciation in very primitive tic-tac-toe bots
GENERATION 0 TOP 4 OF 8 RESULTS
13 fitness, hash 3486bf78
0 1 DUPLICATE -1 2 REVERSE SUB GET 0 EQ NOT 7 IFN 1 ADD -15 RELJUMP
-6 fitness, hash 3486bf60
0 1 DUPLICATE -1 2 REVERSE SUB GET 0 EQ NOT 7 IFN 1 ADD 19 RELJUMP
@jeremyBanks
jeremyBanks / README.md
Created September 6, 2009 07:54
[2010-01] simple python script template

This is a template intended for use as the starting point of simple command-line Python scripts. It wraps the main function, passing on the arguments the script was called with and using the function's return value as the exit code. If an invalid number of arguments are provided, it generates and displays a usage string from the function's argument list and docstring.

Here are some examples that should demonstrate exactly how this works.

def main():