This file contains 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
bash$ GLOBIGNORE="confidential.txt" | |
bash$ ls -l /opt/too_many_files/* | |
secret.txt | |
top_secret.txt | |
public.txt |
This file contains 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
-- Open These views with QGIS | |
-- You can label the ticks view with this expression : "CASE WHEN m % 5 = 0 THEN h END" to get hour numbers | |
-- Set categorized styles on typ and unit to set different styles for dials, and for the hands | |
-- Please tweet your best clock designs with #PostGISClock hashtag | |
create or replace view ticks as | |
select | |
m as id | |
, case when m % 5 = 0 then 'h' else 'm' end as typ | |
, m % 5 as h |
This file contains 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
WITH deltas as ( | |
SELECT | |
st_distance(the_geom::geography, lag(the_geom::geography, 1) over(order by timestamp)) as ddist, | |
timestamp - lag(timestamp, 1) over(order by timestamp) as dt | |
from out_2 offset 1000 | |
) | |
select avg(ddist/dt) as speed from deltas |
This file contains 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
#!/usr/bin/env fab | |
# vim:ts=4:sw=4:tw=120:et:sm:foldmethod=indent | |
import os | |
import time | |
from fabric.api import * | |
from fabric.contrib import files | |
# Global Settings |
This file contains 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
#!/usr/bin/env python | |
""" | |
Feed this program line-oriented JSON tweet data (as received from the API) | |
on STDIN and get unshortened URLs mentioned in the tweets on STDOUT. | |
This module will look up multiple urls at once using the multiprocessing | |
library. Change CONCURRENCY to have more or less processes, defaults to 10. | |
""" |
This file contains 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
The moon is a harsh mistress - Robert A. Heinlein - 5* | |
A canticle for Leibowitz - Walter M. Miller 4* | |
Flowers for Algernon - Daniel Keyes 5* | |
The Forever War - Joe Haldeman - 4* | |
The Stars my destination (also known as Tiger! Tiger!) - Alfred Bester - 5* | |
The Road - Cormac Mc Carthy - 4* | |
God is Dead - Ron Currie Jr. - 4* | |
The world without us - Alan Weisman (not really sci fi, but interesting, anyways) - 4* | |
Animal Farm - George Orwell - 5* | |
1984 - George Orwell - 5* |
This file contains 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
#!/usr/bin/python | |
import unittest | |
import time | |
from throttle import throttle | |
class TestThrottle(unittest.TestCase): | |
@throttle(1) | |
def increment(self): |
This file contains 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
vas-y:parallelz seang$ time parallel wc ::: `find ~/writing/blog/2013 -name *.rst` | |
18 128 791 /Users/seang/writing/blog/2013/10/07/downgrading-my-blog.rst | |
106 567 4011 /Users/seang/writing/blog/2013/10/08/linking-geojson.rst | |
34 249 1586 /Users/seang/writing/blog/2013/10/24/joining-mapbox.rst | |
70 373 2910 /Users/seang/writing/blog/2013/11/24/introducing-rasterio.rst | |
14 45 395 /Users/seang/writing/blog/2013/12/02/geojson-website-refreshed.rst | |
25 158 1256 /Users/seang/writing/blog/2013/12/03/atom-extension-for-tinkerer.rst | |
16 74 627 /Users/seang/writing/blog/2013/11/27/new-home-on-github-for-geojson.rst | |
143 685 6211 /Users/seang/writing/blog/2013/12/04/json-diff-and-patch-for-geojson.rst | |
26 202 1237 /Users/seang/writing/blog/2013/12/05/first-blog-post-at-mapbox.rst |
This file contains 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
#!/usr/bin/env python | |
import sys | |
import logging | |
import tornado.log | |
# For pretty log messages, if available | |
try: | |
import curses | |
except ImportError: | |
curses = None |
This file contains 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 simplejson as json | |
import lxml | |
class objectJSONEncoder(json.JSONEncoder): | |
"""A specialized JSON encoder that can handle simple lxml objectify types | |
>>> from lxml import objectify | |
>>> obj = objectify.fromstring("<Book><price>1.50</price><author>W. Shakespeare</author></Book>") | |
>>> objectJSONEncoder().encode(obj) | |
'{"price": 1.5, "author": "W. Shakespeare"}' | |
""" |
OlderNewer