Skip to content

Instantly share code, notes, and snippets.

#!/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 November 30, 2010 00:10
Fizzbuzz in Python-land
#!/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 16:31
Twisted Benchmark Example
""" 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):

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:

@rlotun
rlotun / gettext-metabase.rb
Created October 16, 2020 23:14
gettext with java
class Gettext < Formula
desc "GNU internationalization (i18n) and localization (l10n) library"
homepage "https://www.gnu.org/software/gettext/"
url "https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.xz"
mirror "https://ftpmirror.gnu.org/gettext/gettext-0.21.tar.xz"
sha256 "d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192"
license "GPL-3.0"
livecheck do
url :stable