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
| """Simple but robust implementation of generator/coroutine-based | |
| pipelines in Python. The pipelines may be run either sequentially | |
| (single-threaded) or in parallel (one thread per pipeline stage). | |
| This implementation supports pipeline bubbles (indications that the | |
| processing for a certain item should abort). To use them, yield the | |
| BUBBLE constant from any stage coroutine except the last. | |
| In the parallel case, the implementation transparently handles thread | |
| shutdown when the processing is complete and when a stage raises an |
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
| #!/usr/bin/env python | |
| # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
| # Written by Nathan Hamiel (2010) | |
| from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
| from optparse import OptionParser | |
| class RequestHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| list of currencies currently in circulation | |
| taken from http://www.currency-iso.org/iso_index/iso_tables/iso_tables_a1.htm | |
| http://www.iso.org/iso/currency_codes_list-1.html | |
| 2011-08-11 | |
| """ |
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
| test: | |
| clear | |
| nosetests --with-coverage --cover-package name_utils test_name_utils.py | |
| clean: | |
| find -regex '.*\.pyc' -exec rm {} \; | |
| find -regex '.*~' -exec rm {} \; | |
| .PHONY: test clean |
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
| #!/usr/bin/env ruby | |
| # | |
| # This script is an astonishing feat of top notch | |
| # rockstar craftsmanship. It totally uses artificial | |
| # intelligence to extract colors out of tmTheme and | |
| # build an itermcolors scheme file for iTerm2. | |
| # | |
| # I know this sounds crazy, but it actually knows | |
| # approximately what colors should be used in the | |
| # ANSI list, and tries to find nearest colors from |
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
| /** | |
| * I converted the SCSS mixin to LESS for the awesome coders like myself in response to a blog post on 37Signals - http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss | |
| * | |
| * Update: 2014-08-04 - Updated a long-standing bug where retina images were shown no matter what in the first background-image property. | |
| * - Updated retina media query to be more reliable () | |
| * Update: 2013-11-13 - Picked up another technique thanks to reading this post from Tyler Tate, auto-fill in the second filename for the retina image, http://tylertate.com/blog/2013/06/11/retina-images-using-media-queries-and-LESS-CSS.html | |
| * Update: 2013-04-16 - Have recently found a few use cases when using a retina pattern from Subtle Patterns on the <body>, this has come in handy | |
| * Update: 2013-04-05 - Some research in the Wordpress Core(http://core.trac.wordpress.org/ticket/22238#comment:5) was pointed out that some tests may be redundant (Thanks @kbav) so I've cleaned these up | |
| * Update: 2012-12-29 - U |
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 RedisCircularBuffer(object): | |
| def __init__(self, namespace, size): | |
| self.namespace = namespace | |
| self.size = size | |
| import redis | |
| self.redis = redis.Redis() | |
| def append(self, item): | |
| self.redis.lpush(self.namespace, item) |
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
| #!/usr/bin/env python | |
| __author__ = 'Kevin Warrick' | |
| __email__ = 'kwarrick@uga.edu' | |
| import cPickle | |
| from functools import wraps | |
| def redis_lru(capacity=5000, slice=slice(None)): | |
| """ | |
| Simple Redis-based LRU cache decorator *. |
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
| ################################################################## | |
| # /etc/elasticsearch/elasticsearch.yml | |
| # | |
| # Base configuration for a write heavy cluster | |
| # | |
| # Cluster / Node Basics | |
| cluster.name: logng | |
| # Node can have abritrary attributes we can use for routing |
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
| // Simple script to redact almost all text on a webpage | |
| // Copyright (C) 2013 by Yu-Jie Lin | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // |
OlderNewer