Skip to content

Instantly share code, notes, and snippets.

Avatar

Reza Lotun rlotun

View GitHub Profile
View diffstrings_recursive.py
#!/usr/bin/env python
usage = """usage: %prog [options] path1 path2 ...
diffstrings compares your primary locale with all your other locales to help you determine which new strings need to be translated. It outputs XML files which can be translated, and then merged back into your strings files.
The path arguments supplied to this script should be the path containing your source files. The file system will be searched to find the .lproj directories containing the Localizable.strings files that the script will read and write.
"""
import os.path, codecs, optparse, re, datetime
@rlotun
rlotun / fizzbuzz.py
Created Nov 30, 2010
Fizzbuzz in Python-land
View fizzbuzz.py
#!/usr/bin/python
for i in xrange(1, 101):
print ''.join(['fizz' if i % 3 == 0 else '', 'buzz' if i % 5 == 0 else '']) or i
# or simply:
print '\n'.join([''.join(['fizz' if i % 3 == 0 else '', 'buzz' if i % 5 == 0 else '']) or str(i) for i in xrange(1, 101)])
# command-line one liner foo:
python -c "print '\n'.join([''.join(['fizz' if i % 3 == 0 else '', 'buzz' if i % 5 == 0 else '']) or str(i) for i in xrange(1, 101)])"
@rlotun
rlotun / tx-benchmark.py
Created May 16, 2011
Twisted Benchmark Example
View tx-benchmark.py
""" A Twisted benchmark example. See:
http://www.ostinelli.net/a-comparison-between-misultin-mochiweb-cowboy-nodejs-and-tornadoweb/comment-page-1/#comment-32785
"""
from twisted.web import server, resource
class MainHandler(resource.Resource):
isLeaf = True
def render_GET(self, request):
View keybase.md

Keybase proof

I hereby claim:

  • I am rlotun on github.
  • I am rlotun (https://keybase.io/rlotun) on keybase.
  • I have a public key whose fingerprint is 4CB0 73FC 79B0 2275 89C3 5689 FC13 4302 26B9 AAE9

To claim this, I am signing this object:

You can’t perform that action at this time.