Skip to content

Instantly share code, notes, and snippets.

View jkakar's full-sized avatar

Jamu Kakar jkakar

View GitHub Profile
@jkakar
jkakar / gist:1264344
Created October 5, 2011 12:52
Wikipedia page XML snippet
<page>
<title>AmoeboidTaxa</title>
<id>24</id>
<redirect />
<revision>
<id>74466889</id>
<timestamp>2006-09-08T04:17:51Z</timestamp>
<contributor>
<username>Rory096</username>
<id>750223</id>
@jkakar
jkakar / gist:1277933
Created October 11, 2011 12:18
virtualenv failure
jkakar@rex:~/src/fluidinfo/wikipedia-import$ virtualenv --no-site-packages env
New python executable in env/bin/python
Installing distribute...........
Complete output from command /home/jkakar/src/fluidinfo/wik...ython -c "#!python
\"\"\"Bootstrap distribu...1:])
" --always-copy -U distribute:
Extracting in /tmp/tmpyLN4wB
Traceback (most recent call last):
File "<string>", line 477, in <module>
File "<string>", line 473, in main
@jkakar
jkakar / gist:1699738
Created January 29, 2012 17:28
$GOPATH seems to be ignored by 'go get'
$ go get -x -u launchpad.net/gocheck
cd /usr/lib/go/src/pkg/launchpad.net/gocheck
bzr pull --overwrite
# cd /usr/lib/go/src/pkg/launchpad.net/gocheck; bzr pull --overwrite
launchpad.net/gocheck: exit status 3
@jkakar
jkakar / gist:1756747
Created February 7, 2012 02:33
Wordnik methods...
jkakar@rex:~/src/fluidinfo/fluidinfo.com$ workon fluidinfo.com
(fluidinfo.com)jkakar@rex:~/src/fluidinfo/fluidinfo.com$ cd fluidinfo/
(fluidinfo.com)jkakar@rex:~/src/fluidinfo/fluidinfo.com/fluidinfo$ ./manage.py shell
iPython 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import wordnik
>>> dir(wordnik.Wordnik)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_create_methods', '_do_http', '_populate_methods', '_run_command', 'account_get_api_token_status', 'account_get_authenticate', 'account_get_user', 'account_get_word_lists', 'account_post_authenticate', 'authenticate', 'multi', 'word_get', 'word_get_audio', 'word_get_definitions', 'word_get_examples', 'word_get_frequency', 'word_get_hyphenatio
@jkakar
jkakar / gist:2008836
Created March 9, 2012 21:38
GET /values response with new 'updated-at' data
HTTP/1.1 200 OK
Content-Length: 817
Date: Mon, 02 Aug 2010 13:14:32 GMT
Content-Type: application/json
{
"results" : {
"id" : {
"05eee31e-fbd1-43cc-9500-0469707a9bc3" : {
"fluiddb/about" : {
class Thingy(Storm):
id = Int(...)
_cache = {}
def getValue(self):
if 'value' in self._cache:
return self._cache['value']
else:
# Load value from the database and cache it.
// URI encode some text.
Handlebars.registerHelper('encode', function(property) {
var text = Ember.getPath(this, property);
return encodeURIComponent(text);
});
.emacs:
(when (load "flymake" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "/home/jkakar/.emacs.d/plugins/epylint.py" (list local-file))))
@jkakar
jkakar / gitcleanbranches.sh
Created July 18, 2012 23:45
Deleting merged branches with Git
#!/bin/bash
set -x
# Update the master branch.
git checkout master
git pull upstream master
# Synchronize the remote repository.
git push origin master
@jkakar
jkakar / .gitconfig
Last active December 25, 2015 20:39
[alias]
cleanbranches = !/Users/jkakar/bin/gitcleanbranches.sh