-
Day job: Engineer at Tasty Labs, on a Python/Tornado stack
-
Favorite Python project: NewsBlur, my visual RSS feed reader written entirely in Python on the backend. Uses a 100% python distributed feed fetcher that makes use of celery, mongoengine, pymongo, and Django. Entirely on GitHub: http://github.com/samuelclay/NewsBlur
-
Favorite Conference: Djangocon, where everybody knows they might the right decision to go Python.
-
Python Experience Level: Somewhere between expert and way out of my element.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pageCount = 3; | |
var thumbnails = { | |
1: "http://s3.documentcloud.org/documents/8941/pages/fbi-agent-william-h-lawrence-testifies-before-congress-p1-thumbnail.gif", | |
2: "http://s3.documentcloud.org/documents/8941/pages/fbi-agent-william-h-lawrence-testifies-before-congress-p2-thumbnail.gif", | |
3: "http://s3.documentcloud.org/documents/8941/pages/fbi-agent-william-h-lawrence-testifies-before-congress-p3-thumbnail.gif" | |
}; | |
var thumbnailsHTML = JST.thumbnails({ | |
pageCount : pageCount, | |
thumbnails : thumbnails |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import scipy | |
import scipy.cluster | |
from pprint import pprint | |
image = Image.open('logo_newsblur_512.png') | |
NUM_CLUSTERS = 15 | |
# Convert image into array of values for each point. | |
ar = scipy.misc.fromimage(image) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var someSet = Backbone.Collection.extend({ | |
model : someModel, | |
constructor : function() { | |
this.bind('change', _.bind(function() { | |
onModelChange(); | |
}, this); | |
} | |
}); | |
someModelInstance.set('key', 'value'); // Triggers a `change` that `someSet` will see. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's nothing to do so you just stay in bed / (oh / poor thing) / Why live in the world when you can live in your head? / Oh / And you can go out late from Monday / till Saturday turns into Sunday / and now you're back here at Monday / so you can do it all over again / And we go ah/ah/ah... / I want a refund / I want a light / I want a reason / to make it through the night / All right / And so you finally left school / so now what are you going to do? / Now you're so grown up / yeah / O h / ah / ah / Oh / so mature / Going out late from Monday / chuck up in the street on Sunday / you don't want to live till Monday / and have to do it all over again / And you go ah/ah/ah... / I want a refund / I want a light / I want a reason / for all this night after night after night after night / Oh / I know that it's stupid but I just can't seem to spend a night at home / 'cause my friends left town / and I'm here all alone / Oh oh / Yeah / They say the past must die / for the futur e to be born / In that case / die / l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import feedfinder | |
>>> feedfinder.feed('http://theverge.com') | |
'http://theverge.com/rss/index.xml' | |
>>> import feedparser | |
>>> fp = feedparser.parse('http://theverge.com/rss/index.xml') | |
>>> fp | |
{'feed': {}, 'status': 200, 'bozo': 1, 'headers': {'status': '200 OK', 'content-length': '19383', 'via': '1.1 sbnation.com', 'content-encoding': 'deflate', 'vary': 'Accept-Encoding', 'x-runtime': '578', 'connection': 'Keep-Alive', 'etag': '"fd2f3a5b33a1a706fea1dec62ad25df3"', 'cache-control': 'private, max-age=0, must-revalidate, private, max-age=0, must-revalidate', 'date': 'Fri, 04 Nov 2011 00:06:59 GMT', 'p3p': 'CP="CAO DSP COR CURa ADMa DEVa PSAa PSDa CONi OUR IND PHY ONL UNI COM NAV INT CNT STA"', 'content-type': 'application/xml; charset=utf-8'}, 'etag': u'"fd2f3a5b33a1a706fea1dec62ad25df3"', 'href': u'http://www.theverge.com/rss/index.xml', 'entries': [], 'bozo_exception': error('Error -3 while decompressing data: incorrect header check',)} | |
>>> fp.entries | |
[] |
- #1: 1226 likes - ThinkUp
- #2: 868 likes - Inventor & Entrepreneur Nation (IENation.com)
- #3: 293 likes - UNICEF GIS - Youth Led Digital Mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns radix | |
(:require [clojure.string :as string])) | |
(use 'clojure.java.io) | |
(use 'clojure.pprint) | |
(println "Loading names... ") | |
(time (def names | |
(with-open | |
[rdr (reader | |
"/usr/share/dict/ProperNames")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var RadixTrie = function(words) { | |
this.T = {}; | |
this.initialize(words); | |
}; | |
RadixTrie.prototype = { | |
initialize: function(words) { | |
var self = this; | |
words = words || []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImageOps: | |
"""Module that holds all image operations. Since there's no state, | |
everything is a classmethod.""" | |
@classmethod | |
def adjust_image_orientation(cls, image): | |
"""Since the iPhone will store an image on its side but with EXIF | |
data stating that it should be rotated, we need to find that | |
EXIF data and correctly rotate the image before storage.""" | |
OlderNewer