Skip to content

Instantly share code, notes, and snippets.

View KushalP's full-sized avatar

Kushal Pisavadia KushalP

View GitHub Profile
source "https://rubygems.org"
gem "hamster", "0.4.3"
gem "nokogiri", "1.5.9"
diff --git a/Gemfile b/Gemfile
index f56d45c..8c3b2ea 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,11 +1,9 @@
source :rubygems
source "https://[email protected]/govuk/"
-gem "unicorn", "4.3.1"
gem "sinatra", "1.3.4"
@KushalP
KushalP / party_time.py
Created March 4, 2013 01:46
Insomnia kicked in, so I tinkered with Python and trolled myself
import datetime
import imp
class PartyTime():
def __call__(self, *args):
imp.reload(datetime)
value = datetime.datetime(*args)
datetime.datetime = self
return value
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=utf-8
Status: 200 OK
X-UA-Compatible: IE=Edge,chrome=1
ETag: "976aea2f1c04a9d78f389b0b27b87263"
X-Request-Id: c4a0b9c5861d408bd7d944984781b449
X-Varnish: 1821039272
Strict-Transport-Security: max-age=31536000
Cache-Control: public, max-age=1289
@KushalP
KushalP / gist:4502481
Created January 10, 2013 14:36
Git prompt (PS1)
source /etc/bash_completion.d/git
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export PS1="\e[0;33m\u@\h \w\e[0;32m\$(__git_ps1 ' (%s)')\e[0;96m \$\e[0m "
@KushalP
KushalP / books.txt
Created December 17, 2012 23:45
Tonight (17/12/2012) I asked on Twitter what books people have enjoyed this year. Not all of the posters provided authors, but this should suffice. The list is provided in alphabetical order rather than in reply order.
Anansi Boys
Angelmaker by @Harkaway
Baroque Cycle, The
Basement, The
Being Geek
Building Stories
Cryptonomicon
Death by Black Hole: And Other Cosmic Quandaries
Edible Selby, by Todd Selby
Emperor of All Maladies, The
/**
* The Nomensa accessible media player is a flexible multimedia solution for websites and intranets.
* The core player consists of JavaScript wrapper responsible for generating an accessible HTML toolbar
* for interacting with a media player of your choice. We currently provide support for YouTube (default),
* Vimeo and JWPlayer although it should be possible to integrate the player with almost any media player on
* the web (provided a JavaScript api for the player in question is available).
*
* Copyright (C) 2012 Nomensa Ltd
*
* This program is free software: you can redistribute it and/or modify
@KushalP
KushalP / output.sh
Created June 17, 2012 22:22
Attempt at implementing Python decorators in Ruby
$ ruby squarer.rb
about to call square(5)
25
about to call cube(5)
125
@KushalP
KushalP / gyp_chromium_output.py
Created March 22, 2012 19:19
What happens when you print 'descendants' before "def EnsureNoIDCollisions(self)" does its thing
This file has been truncated, but you can view the full file.
[<XCProjectFile at 0x1087f9390>,
<PBXProject 'chrome' at 0x1087f9190>,
<PBXGroup None at 0x1087f91d0>,
<PBXGroup 'Source' at 0x1088afdd0>,
<PBXGroup '..' at 0x1088afd10>,
<PBXGroup 'base' at 0x108e39a90>,
<PBXGroup 'files' at 0x10964d610>,
<PBXFileReference 'file_path_watcher_browsertest.cc' at 0x10964d810>,
<PBXGroup 'test' at 0x108e43190>,
<PBXFileReference 'run_all_unittests.cc' at 0x108e43110>,
Testing ring.middleware.test.cookies
ERROR in (wrap-cookies-accepts-expires) (cookies.clj:103)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.AssertionError: Assert failed: (every? valid-attr? attrs)
at ring.middleware.cookies$write_attr_map.invoke (cookies.clj:103)
ring.middleware.cookies$write_cookies$iter__665__669$fn__670.invoke (cookies.clj:122)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:56)