I hereby claim:
- I am agriffis on github.
- I am agriffis (https://keybase.io/agriffis) on keybase.
- I have a public key ASAG-vNw34R-v-jUZ7WrUrAU7E0UD16csjTPJMRQegh-sgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I've been using Firefox for a long time, partly because it works well, and partly because I believe in the manifesto. Chrome exists for Google, but Firefox exists for me. I usually only fire up Chrome for testing compatibility.
However today I tried using Chrome for the sake of the Evernote Web Clipper, which sucks on Firefox. But everything is fuzzy in Chrome!
Turns out that Chrome doesn't respect the OS settings for font hinting. Here's how that page looks on both browsers:
from django.core.cache import get_cache | |
class KeyedCache(object): | |
""" | |
Proxied cache object to allow objects to implement their own keying, | |
for example a Django model can implement per-row caching with: | |
def cache_key(self, key): | |
return '{}.{}.{}'.format(self.__class__.__name__, self.pk, key) |
#!/bin/bash | |
sleep_for=$1 | |
shift | |
( | |
"$@" | |
status=$? | |
if [[ $status == 0 ]]; then |
""" | |
Patch Python's sys.stdout and sys.stderr to encode to UTF-8 | |
The short story is that sys.stdout.encoding is set based on the environment | |
variable LC_CTYPE (or LANG/LC_ALL) but only when stdout.isatty(). | |
Otherwise those variables are ignored and stdout has no encoding, and it | |
CANNOT be set. | |
The long story is here (especially in the comments): | |
http://drj11.wordpress.com/2007/05/14/python-how-is-sysstdoutencoding-chosen/ |
#!/bin/bash | |
# | |
# gpgsig, a little script to sign your gpg/pgp keys | |
# | |
# Copyright 2006,2013 Aron Griffis <agriffis@n01se net> | |
# Released under the GNU GPL v2 | |
# | |
# Based loosely on ideas Damien Chrisment's gpgsig, but written from scratch to | |
# be simpler and just do what I need. Simply: | |
# |
def walk_url_tree(urls): | |
""" | |
Generator to walk a tree consisting of RegexURLPattern (with callback) | |
and RegexURLResolver (with nested url_patterns). | |
""" | |
for u in urls: | |
if hasattr(u, 'url_patterns'): | |
for u2 in walk_url_tree(u.url_patterns): | |
yield u2 | |
else: |
def walk_url_tree(urls): | |
""" | |
Generator to walk a tree consisting of RegexURLPattern (with callback) | |
and RegexURLResolver (with nested url_patterns). | |
Recursive depth-first. | |
""" | |
for u in urls: | |
if hasattr(u, 'url_patterns'): | |
for u2 in walk_url_tree(u.url_patterns): |
#!/bin/bash | |
if glxinfo | grep -q 'NVIDIA Corporation'; then | |
case /$0 in | |
*/sitdown) xrandr -s 1 ;; | |
*/standup) xrandr -s 0 ;; | |
esac | |
else | |
hdmi=HDMI-1 | |
dvi=DVI-D-1 |
#!/bin/bash | |
hdmi=HDMI-1 | |
dvi=DVI-D-1 | |
case /$0 in | |
*/sitdown) xrandr --output $hdmi --auto ; xrandr --output $dvi --off ;; | |
*/standup) xrandr --output $dvi --auto ; xrandr --output $hdmi --off ;; | |
esac |