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 | |
| import sys | |
| phrase = sys.argv[1] | |
| parts = [l + l.upper() for l in phrase.lower()] | |
| regex = ''.join(['[%s]' % part for part in parts]) | |
| print regex |
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: Justin Lintz | |
| # usage: ./focal_length dir | |
| # Requiresments: dcraw http://www.cybercom.net/~dcoffin/dcraw/ | |
| import os | |
| import sys | |
| from subprocess import Popen, PIPE | |
| from operator import itemgetter | |
| DCRAW='dcraw' # or /path/to/dcraw |
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 approx::server { | |
| package {'approx': | |
| ensure => latest; | |
| } | |
| config_file { "/etc/approx/approx.conf": | |
| source => "puppet://$servername/approx/approx.conf", | |
| require => Package['approx'], | |
| } |
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 urllib2 import urlopen | |
| from urllib import urlencode | |
| import simplejson | |
| class SolrSearcher: | |
| def __init__(self, url): | |
| self.url = url | |
| def search(self, q, **kwargs): | |
| args = {'q': q, 'wt': 'json'} |
NewerOlder