A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| """ | |
| This file contains code that, when run on Python 2.7.5 or earlier, creates | |
| a string that should not exist: u'\Udeadbeef'. That's a single "character" | |
| that's illegal in Python because it's outside the valid Unicode range. | |
| It then uses it to crash various things in the Python standard library and | |
| corrupt a database. | |
| On Python 3... well, this file is full of syntax errors on Python 3. But | |
| if you were to change the print statements and byte literals and stuff: |
| # Notes for installing on Samsung Series 9 | |
| # UEFI boot: LVM on LUKS | |
| # | |
| # See the full blog post: | |
| # http://jasonwryan.com/blog/2013/01/25/uefi/ | |
| # check you are booted in uefi | |
| modprobe efivars | |
| ls /sys/firmware/efi/vars |
| #!/usr/bin/env python2 | |
| """Delete tweets older than X days. | |
| Usage: | |
| rmtweets.py [at_least_days_old (default=365)] | |
| """ | |
| # Twitter gives access to only the last 3200 tweets, but if you delete | |
| # more recent tweets, then after some time (a week? a month?) the |
Since this is on Hacker News and reddit...
_t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".char *s.type * name, however, is entirely intentional.This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This article is now published on my website: Prefer Subshells for Context.
| #!/usr/bin/tclsh8.5 | |
| # | |
| # Usage: unmerged branch1 branch2 | |
| proc getlog branch { | |
| lrange [split [exec git log $branch --oneline] "\n"] 0 100 | |
| } | |
| proc diff {title c1 c2} { | |
| puts "\n$title" |