Skip to content

Instantly share code, notes, and snippets.

View daf's full-sized avatar
✴️
halp

Dave Foster daf

✴️
halp
View GitHub Profile
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@daf
daf / README.md
Created February 28, 2014 14:57 — forked from milroc/README.md

d3.unconf example gist. Fork it here.

@daf
daf / keybase.md
Last active August 29, 2015 14:01
keybase.md

Keybase proof

I hereby claim:

  • I am daf on github.
  • I am daf (https://keybase.io/daf) on keybase.
  • I have a public key whose fingerprint is 5B8B 0063 3A07 4378 35C8 0B7F 1E39 A08E DAB8 F316

To claim this, I am signing this object:

@daf
daf / d3reads.md
Created May 19, 2014 15:49
D3 Reads
@daf
daf / index.html
Last active August 29, 2015 14:01 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke-linejoin: round;
}
.sphere,
@daf
daf / index.html
Last active August 29, 2015 14:01
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke-linejoin: round;
}
.sphere,
@daf
daf / sample_subscriber.py
Created January 6, 2011 16:46
Sample uses of the subscriber class within the context of a process
class SampleProcess(Process):
###
### 1. Subclass subscriber to override what you want
###
class ANFSubscriber(Subscriber):
def ondata(self, data):
print "custom handling of ANF data"
diff --git a/ion/core/messaging/messaging.py b/ion/core/messaging/messaging.py
index 61a8930..1bca0cd 100644
--- a/ion/core/messaging/messaging.py
+++ b/ion/core/messaging/messaging.py
@@ -212,15 +212,8 @@ class Consumer(messaging.Consumer):
@param config is a dict of amqp options that __init__ extracts.
"""
connection = ex_space.connection # broker connection
- # @TODO: Exchange config dict should not clobber the passed in config dict -
- # it means that I cannot create a queue with auto_delete=False if the
@daf
daf / inttest_ingest.py
Created March 24, 2011 20:02
integration test for ingestion
#!/usr/bin/env python
"""
@file inttest_ingest.py
@author Dave Foster <dfoster@asascience.com>
@test
"""
import ion.util.ionlog
from twisted.internet import defer
@daf
daf / gist:1187211
Created September 1, 2011 20:39
lrudict bug
diff --git a/ion/util/cache.py b/ion/util/cache.py
index cdee405..3555ffd 100644
--- a/ion/util/cache.py
+++ b/ion/util/cache.py
@@ -125,9 +125,14 @@ class LRUDict(object):
def purge(self):
while self.total_size > self.limit:
if self.first == self.last:
+ obj = self.first.me[1]
+ if hasattr(obj, 'clear'):