Skip to content

Instantly share code, notes, and snippets.

View jeremyBanks's full-sized avatar

Jeremy Banks jeremyBanks

  • Canada
  • 18:34 (UTC -04:00)
View GitHub Profile
@jeremyBanks
jeremyBanks / euler002.lisp
Created August 22, 2008 21:49
[2010-01] experimenting with sbcl, i guess
#!/usr/bin/env sbclx
(let
((sum 0)) ; the sum of the even valued terms of fib
; this is the only variable we need outside of the scope of the loop
(do
(
(ubound 4000000) ; that do not excede this value
(previous 1) ; the value of the previous term
(current 1) ; the value of the current term
@jeremyBanks
jeremyBanks / euler003.lisp
Created August 22, 2008 22:01
[2010-01] some project euler stuff in sbcl
#!/usr/bin/env sbclx
; I actually might want to use a function? Goodie!
(defun isPrime (n) ; a crude brute-force prime check
(do
(
(limit (ceiling (sqrt n))) ; maximum requred to determine if it is prime
(i 2 (1+ i))
)
@jeremyBanks
jeremyBanks / ghapitest.py
Created August 26, 2008 22:39
[2010-01] me trying out github's api
#!/usr/bin/env python
# encoding: utf-8
import demjson
from pprint import pprint
import urllib2
def main():
user = "jeremybanks"
userJSON = urllib2.urlopen("http://github.com/api/v1/json/%s/" % user).read()
user = demjson.decode(userJSON)["user"]
@jeremyBanks
jeremyBanks / gist:7940
Created August 29, 2008 08:49
[2010-01] me noobing it up with gpg and git
git # master $ git tag -v v0.99.1
object 78d9d414123ad6f4f522ffecbcd9e4a7562948fd
type commit
tag v0.99.1
tagger Linus Torvalds <[email protected]> 1121468952 -0700
The snail-paced race towards 1.0 is on!
gpg: Signature made Fri 15 Jul 19:09:53 2005 EDT using DSA key ID 76E21CBB
gpg: Can't check signature: public key not found
error: could not verify the tag 'v0.99.1'
@jeremyBanks
jeremyBanks / marijuana.reddit.css
Created August 31, 2008 21:02
[2010-01] old reddit trees theme
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td,iframe {
margin:0;
padding:0;
}
table { border-collapse:collapse; }
fieldset,img { border:0; }
address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; }
@jeremyBanks
jeremyBanks / wgetOSX.sh
Created September 3, 2008 06:53
[2010-01] a few lines to install wget using curl
# It's just a basic ./configure; make; sudo make install.
curl -O http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz # Irony?
tar xzf wget-latest.tar.gz
cd wget-*/
./configure
make
sudo make install
@jeremyBanks
jeremyBanks / slotDemo.py
Created September 4, 2008 18:52
[2010-01] an old example of how __slots__ works
#!/usr/bin/env python
# encoding: utf-8
from __future__ import division, with_statement
import sys, os
class StrictPerson(object):
__slots__ = ["first", "last", "age"]
def __str__(self):
return "%s %s (%s)" % (self.first, self.last, self.age)
@jeremyBanks
jeremyBanks / fibonacciPosters.json
Created September 7, 2008 01:58
[2010-01] data on some people who had posted in the fibbonoachi thread on reddit
{ 1 : { "N" : 1,
"author" : "cyk",
"post" : "c2mlyk"
},
10 : { "N" : 10,
"author" : "Nanten",
"post" : "c2mmk1"
},
100 : { "N" : 100,
"author" : "boffo",
@jeremyBanks
jeremyBanks / gist:9224
Created September 7, 2008 03:02
[2010-01] numbers written using entirely hexable characters
# Numbers that can be written in hex characters.
# 1 may only use as L or I exclusively in a given word.
# egrep -i "^([ABCDEFOLZSGT]+|[ABCDEFOIZSGT]+)$" /usr/share/dict/words
A
a
aa
aal
Ab
aba
abac
@jeremyBanks
jeremyBanks / gist:9430
Created September 8, 2008 13:08
[2010-01] 20 character in bash that are probably bad-practice and check if you have python remotes, I guess
[ "`git remote`" != "" ]