As configured in my dotfiles.
start new:
tmux
start new with session name:
| # Basic text search with relevancy for MongoDB. | |
| # See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/ | |
| # Copythingie 2010 - Ward Bekker - [email protected] | |
| #create (or empty) a docs collection | |
| doc_col = MongoMapper.connection.db('example_db').collection('docs') | |
| doc_col.remove({}) | |
| #add some sample data | |
| doc_col.insert({ "txt" => "it is what it is"}) |
| #!/usr/bin/env python | |
| """ | |
| Usage: | |
| ./rtail.py user@host:path/foo.log bar.log host2:/path/baz.log | |
| """ | |
| import optparse | |
| import os |
| (function(){ | |
| var aff = 'nathos-20'; // replace 'nathos-20' with your Amazon affiliate ID, including the '-20' | |
| if (!document.getElementById('ASIN')) { | |
| alert('Can\'t find an Amazon product ID'); | |
| return; | |
| } | |
| var asin = document.getElementById('ASIN').value; | |
| prompt( | |
| 'Here is the shortened affiliate link:', | |
| 'http://amzn.com/' + asin + '?tag=' + aff); |
| <?php | |
| /** | |
| Trasliterate method takes 5 , seaparated english words and transliterates them into Kannada, | |
| The result is an array of words in the same order. This uses Non public Google online transliteration API for this. | |
| When you run this method give a 10ms seconds gap between each call to be on the safer side. | |
| By : Thejesh GN http://thejeshgn.com | |
| More: http://thejeshgn.com/2011/02/04/batch-transliterating-names-into-kannada-using-google-api/ |
| application: you-app-name-here | |
| version: 1 | |
| runtime: python | |
| api_version: 1 | |
| default_expiration: "30d" | |
| handlers: | |
| - url: /(.*\.(appcache|manifest)) | |
| mime_type: text/cache-manifest |
| _.each(['Start', 'Stop', 'Complete', 'Error', 'Success', 'Send'], function(s){ | |
| $(window)['ajax' + s](function(event, xhr, options) { | |
| // your instrumentation goes here | |
| console.log('ajax' + s); | |
| }); | |
| }); |
| // force certain pages to be refreshed every time. mark such pages with | |
| // 'data-cache="never"' | |
| // | |
| jQuery('div').live('pagehide', function(event, ui){ | |
| var page = jQuery(event.target); | |
| if(page.attr('data-cache') == 'never'){ | |
| page.remove(); | |
| }; | |
| }); |
| # -*- coding: utf-8 -*- | |
| """ | |
| amazon_sender.py | |
| ~~~~~~~~ | |
| Python helper class that can send emails using Amazon SES and boto. | |
| The biggest feature of this class is that encodings are handled properly. | |
| It can send both text and html emails. | |
| This implementation is using Python's standard library (which opens up for a lot more options). |
| from PIL import Image | |
| from PIL.ExifTags import TAGS, GPSTAGS | |
| def get_exif_data(image): | |
| """Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags""" | |
| exif_data = {} | |
| info = image._getexif() | |
| if info: | |
| for tag, value in info.items(): | |
| decoded = TAGS.get(tag, tag) |
As configured in my dotfiles.
start new:
tmux
start new with session name: