ches


Member since 07/18/2007

Name: Ches

ches

Location: Cambridge, MA

Website: http://chesmart.in

12 snippets

6 profile views

View their favorites

Profile

All time reputation: 14

Achievement

first submission:submitting first snipplet

ches's Recent Snippets



« Prev 1 Next »
  1. FAV

    chdir context manager

    This context manager restores the value of the current working directory (cwd) after the enclosed code block completes or raises an exception. If a directory name is supplied to the context manager then the cwd is changed prior to running the code b...
    Python 3 views posted 8 years ago ches
  2. FAV

    imapsync script to migrate Gmail to Google Apps

    Based on the good initial coverage [over here](http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration/).
    Bash saved by 8 people 1 views posted 10 years ago ches
  3. FAV

    Compute Directory Size Recursively with du

    Bash 0 views posted 11 years ago ches
  4. FAV

    Perl Search and Replace One-liner with xargs -0

    \Q...\E perl quoting means no ugly escaping in the regex. find's -print0 with xargs -0 is the secret to handling files with spaces in their names.
    Bash saved by 32 people 5 views posted 12 years ago ches
  5. FAV

    Deleting Blank Lines Using AWK

    Create a copy of a text file with blank lines removed.
    Bash 1 views posted 12 years ago ches
  6. FAV

    Ruby One-liner for Restoring One Table from a Huge SQL Dump

    Courtesy of Jesse.
    Ruby saved by 32 people 1 views posted 12 years ago ches
  7. FAV

    Alternate Table Row Classes in a Mako Template

    Python 2 views posted 12 years ago ches
  8. FAV

    Quick, Simple Password Generator

    Obviously there's no real crytpo here -- use this for cases like regenerating and emailing a user password.
    Python saved by 1 person 2 views posted 12 years ago ches
  9. FAV

    Batch File Rename with awk and sed

    Leave off the final pipe to /bin/sh to do a 'dry run'
    Bash saved by 12 people 7 views posted 12 years ago ches
  10. FAV

    FormEncode Email Address validation schema

    model/form.py is a good place to put schemata in a pylons app: easy to build with inheritance and accessible to controllers via model.form.EmailForm, etc. See the link for further info on the _extra_fields options -- this one is intended for just two...
    Python saved by 4 people 1 views posted 12 years ago ches
  11. FAV

    python date suffixes for strftime

    like PHP's 'jS'
    Python 0 views posted 12 years ago ches
  12. FAV

    htaccess one-liner for MT URL restructuring

    Build URLs for subcategories, e.g. 'cat-child-support.html' becomes '/family-law/child-support/'
    XML 1 views posted 12 years ago ches
« Prev 1 Next »