Skip to content

Instantly share code, notes, and snippets.

Avatar

Shrikant Sharat Kandula sharat87

View GitHub Profile
@sharat87
sharat87 / client.py
Created May 11, 2012
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
View client.py
#!/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 Apr 24, 2012
Operating System dependent dispatch of multimethods in clojure
View README.md

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 Aug 31, 2011
Lieningen breaks clojure.java.shell/sh function
View README.md

(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 Aug 18, 2011
Immutable record like objects that just hold a bunch of data and stay immutable for the forseeable future
View immutability.py
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
class ImmutabilityException(BaseException):
pass
class ImmutableRecord(object):