Skip to content

Instantly share code, notes, and snippets.

View tmm1's full-sized avatar

Aman Gupta Karmani tmm1

View GitHub Profile
@tmm1
tmm1 / .block
Last active April 16, 2020 22:51 — forked from piwodlaiwo/.block
World Map in D3v4 with Queue and Tooltips
license: mit
@tmm1
tmm1 / vimrc
Created November 26, 2013 10:07 — forked from alloy/gist:7527832
" These VIM rules match the MRI C indentation rules.
"
" To enable use of this project specific config, add the following to your
" ~/.vimrc:
"
" " Enable per-directory .vimrc files
" set exrc
" " Disable unsafe commands in local .vimrc files
" set secure
@tmm1
tmm1 / elitedesktop.md
Created April 9, 2012 08:00
How to pimp your linux

THIS ASSUMES YOU RUN DEBIAN (or ubuntu, mint) AND ARE NOT A SUCKA MC

XDM

sudo aptitude install xdm
sudo echo '/usr/bin/xdm' > /etc/X11/default-display-manager

spectrwm, dmenu

sudo aptitude install dmenu libxtst-dev
git clone git://opensource.conformal.com/spectrwm.git
cd spectrwm/linux

diff --git a/ext/ruby_http_parser/ruby_http_parser.c b/ext/ruby_http_parser/ruby_http_parser.c
index 119d7e1..5650652 100644
--- a/ext/ruby_http_parser/ruby_http_parser.c
+++ b/ext/ruby_http_parser/ruby_http_parser.c
@@ -320,6 +320,9 @@ VALUE Parser_execute(VALUE self, VALUE data) {
size_t nparsed = ryah_http_parser_execute(&wrapper->parser, &settings, ptr, len);
if (wrapper->parser.upgrade) {
+ if (RTEST(wrapper->stopped))
+ nparsed += 1;
@tmm1
tmm1 / dpkg.rb
Created September 13, 2011 02:40 — forked from benburkert/dpkg.rb
homebrew formula to get dpkg working a mac
require 'formula'
class Dpkg <Formula
url 'http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.16.0.3.tar.bz2'
homepage 'http://en.wikipedia.org/wiki/Dpkg'
md5 '0266b06ef9da8278cea008d21e17e5f6'
depends_on 'gnu-tar'
# depends_on 'cmake'
@tmm1
tmm1 / sigh.rb
Created January 2, 2011 23:31 — forked from hobodave/sigh.rb
require 'rubygems'
require 'eventmachine'
module ProxyConnection
def initialize(client)
@client = client
end
def post_init
proxy_incoming_to(@client)
# What is the best way to get it to put out a, b, c
# without erroring about the superclass. The module
# inclusion order should not matter. In other words,
# I should be able to include A then B or B then A
# and either way all the letters a, b, and c are
# printed out (though not necessarily in that exact order)
module A
def foo
super
@tmm1
tmm1 / gist:111491
Created May 14, 2009 04:55 — forked from mattetti/gist:111453
net/http vs fibered em-http
require 'net/http'
require 'uri'
url = URI.parse 'http://localhost:5984/test/test'
req = Net::HTTP::Get.new(url.path)
start = Time.now
100.times do
http = Net::HTTP.start(url.host, 5984)
http.request(req)
@tmm1
tmm1 / example_note_keeping_app.rb
Created April 11, 2009 13:48 — forked from pietern/example_note_keeping_app.rb
sinatra + redis note keeping app
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
@tmm1
tmm1 / gist:80053
Created March 16, 2009 20:27 — forked from raggi/gist:79926
# async_sinatra_example.ru
require 'sinatra'
# Normally Sinatra::Base expects that the completion of a request is
# determined by the block exiting, and returning a value for the body.
#
# In an async environment, we want to tell the webserver that we're not going
# to provide a response now, but some time in the future.
#
# The a* methods provide a method for doing this, by informing the server of