Skip to content

Instantly share code, notes, and snippets.

scollins@Sean-Collins-MBPr15 ~/src/philly-bike-router ±master⚡ » python philly-bike-router/cli.py
11th & Pine, Kahn Park is nearly full - 2 spaces left
33rd & Market is nearly empty - 1 bike left
15th & Spruce is nearly empty - 2 bikes left
38th & Lancaster has no bikes
4th & Walnut, NPS is nearly empty - 2 bikes left
12th & Filbert has no bikes
6th & Race has no bikes
University City Station is nearly empty - 1 bike left
18th & JFK has no bikes
@sc68cal
sc68cal / ipv6_in_virtualbox.md
Last active August 29, 2015 14:20
IPv6 in VirtualBox

VirtualBox allows the creation of IPv6 networking prefixes on Host-Only adapters. It will statically assign an address to the interface, however it will not advertise the route. Meaning that guest VMs that are attached to the Host-Only network will not configure their IPv6 stacks automatically.

radvd (or rtadvd on *BSD) can be configured to advertise the IPv6 prefix that has been created in VirtualBox, however there is an issue in some operating systems, where the IPv6 stack cannot simultaneously be a host as well as a router (forward packets).

Linux Support

https://lkml.org/lkml/2011/7/26/482

[14:04] <-- | Guest73669 [~sree@72.28.92.15] has quit (K-Lined)
[14:04] <-- | Sukhdev [~textual@72.28.92.15] has quit (K-Lined)
[14:04] <-- | ashleighfarnham [~ashleighf@72.28.92.15] has quit (K-Lined)
[14:04] <-- | rbradfor [~rbradfor@72.28.92.15] has quit (K-Lined)
[14:04] <-- | salv-orlando [~salv_orla@72.28.92.15] has quit (K-Lined)
[14:04] <-- | hdd [~chris@72.28.92.15] has quit (K-Lined)
[14:04] <-- | ayoung [~ayoung@72.28.92.15] has quit (K-Lined)
[14:04] <-- | nikeshm [~nikeshm@72.28.92.15] has quit (K-Lined)
[14:04] <-- | rossella_s [~rossella@72.28.92.15] has quit (K-Lined)
[14:04] <-- | dims [~dims@72.28.92.15] has quit (K-Lined)
scollins@Uller ~/Downloads » grep -b 'DESIGNATOR' 1033-program-foia-may-2014.csv\?raw=true
7309982:IL,MADISON,1240-01-142-9546,"RANGE FINDER-TARGET DESIGNATOR,LASER",2,Each,112734,2011-02-10
7381840:IL,MENARD,1240-01-142-9546,"RANGE FINDER-TARGET DESIGNATOR,LASER",1,Each,112734,2012-05-07
7935077:IN,LAGRANGE,1240-01-142-9546,"RANGE FINDER-TARGET DESIGNATOR,LASER",2,Each,112734,2011-03-01
8459788:KY,BOYLE,1240-01-575-1124,"RANGE FINDER-TARGET DESIGNATOR,LASER",1,Each,73929,2012-06-14
14021313:PA,BLAIR,1240-01-142-9546,"RANGE FINDER-TARGET DESIGNATOR,LASER",2,Each,112734,2011-09-02
14106941:PA,PHILADELPHIA,1240-01-142-9546,"RANGE FINDER-TARGET DESIGNATOR,LASER",1,Each,112734,2012-01-25
15426153:TX,CASS,1260-99-551-6393,"TRIPOD,TARGET DESIGNATOR,LASER",1,Each,0,2011-12-13
16572451:TX,WICHITA,1240-01-142-9546,"RANGE FINDER-TARGET DESIGNATOR,LASER",1,Each,112734,2011-08-12
16872584:VA,ARLINGTON,1240-01-575-1124,"RANGE FINDER-TARGET DESIGNATOR,LASER",2,Each,73929,2013-01-22
@sc68cal
sc68cal / level.py
Created March 28, 2011 15:22
Recursive algorithm test
class level(object):
def __init__(self, date):
self.children = []
self.date = date
def addchild(self,child):
self.children.append(child)
def latest_date(self):
if not self.children:
return self.date
QR Libraries for Python:
http://code.google.com/p/pyqrnative/
https://github.com/hcvst/pyqr
http://pyqrcode.sourceforge.net/
GeoDjango:
http://docs.djangoproject.com/en/1.3/ref/contrib/gis/
diff --git a/helix/hiv/forms.py b/helix/hiv/forms.py
index cbf4a56..5938603 100644
--- a/helix/hiv/forms.py
+++ b/helix/hiv/forms.py
@@ -4,7 +4,7 @@ from django.http import HttpResponseRedirect
from django import forms
from helix.hiv.models import *
from django.contrib.formtools.wizard import FormWizard
-from datetime import datetime
+import time
@sc68cal
sc68cal / main.py
Created April 23, 2011 20:41
Dynamsoft Issue -> Github Issues
from github2.client import Github
import csv
import sys
import re
project = sys.argv[4]
github = Github(username=sys.argv[2], api_token=sys.argv[3],requests_per_second=.25)
data = csv.reader(open(sys.argv[1]))
@sc68cal
sc68cal / map.py
Created April 23, 2011 20:41
MapReduce example
#!/usr/bin/env python
import sys
import re
prog = re.compile("From.*\S{3}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{2}:\d{2}:\d{2}\s\d{4}")
for line in sys.stdin:
res = prog.search(line.strip())
if res:
res = res.group().split(" ")
print '%s %s %s %s\t%s' % (res[2],res[3],res[4],res[6],1)
c:\Program Files (x86)\Git\bin\git.exe push "origin" master:master
Done
remote: Push worked, but post-receive failed: Connection reset by peer
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:234:in `ensure_connected'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:114:in `process'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:183:in `logging'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:113:in `process'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis/client.rb:38:in `call'
remote: /data/github/current/vendor/gems/ruby/1.8/gems/redis-2.2.0/lib/redis.rb:428:in `sadd'
remote: /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'