Skip to content

Instantly share code, notes, and snippets.

View sharat87's full-sized avatar

Shrikant Sharat Kandula sharat87

View GitHub Profile
@sharat87
sharat87 / client.py
Created May 11, 2012 17:00
Code for my article on serializing session objects of python-requests library. http://sharats.me/serializing-python-requests-session-objects-for-fun-and-profit.html
#!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
import requests as req
URL_ROOT = 'http://localhost:5050'
def get_logged_in_session(name):
@sharat87
sharat87 / README.md
Created April 24, 2012 06:31
Operating System dependent dispatch of multimethods in clojure

This is me trying out clojure's multimethods for a problem I'm trying to solve. See this Stack Overflow question for follow up.

Note that implementation namespaces are named utils-linux and utils-windows instead of utils.linux and utils.windows because Gists can't have subdirectories.

@sharat87
sharat87 / README.md
Created August 31, 2011 14:59
Lieningen breaks clojure.java.shell/sh function

(using .. in gist file names instead of /)

With this project setup and running

lein run

I get the error

Copying 1 file to /home/sharat/labs/experiments/clojure/thread-sh/lib

Exception in thread "Thread-0" java.lang.RuntimeException: java.util.concurrent.RejectedExecutionException

@sharat87
sharat87 / immutability.py
Created August 18, 2011 11:44
Immutable record like objects that just hold a bunch of data and stay immutable for the forseeable future
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
class ImmutabilityException(BaseException):
pass
class ImmutableRecord(object):