Skip to content

Instantly share code, notes, and snippets.

View igrigorik's full-sized avatar
:octocat:

Ilya Grigorik igrigorik

:octocat:
View GitHub Profile
@carsonmcdonald
carsonmcdonald / revspdynpn.sh
Created April 27, 2011 14:52
How to set up ruby, eventmachine and spdy to use NPN
#
# Get development tools installed
#
sudo yum install -y git cvs zlib-devel
sudo yum groupinstall -y "Development Tools"
#
# Install RVM
#
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
@mrflip
mrflip / async_aroundware_demo.rb
Created May 1, 2011 07:13
Goliath middleware that does an asynchronous request, and only proceeds with the response when both the endpoint and our middleware's responses have completed
#!/usr/bin/env ruby
$: << File.dirname(__FILE__)+'/lib'
require 'goliath'
require 'em-synchrony/em-http'
#
# Here's an example of how to make an asynchronous request in the middleware,
# and only proceed with the response when both the endpoint and our middleware's
# responses have completed.
#!/usr/bin/env ruby
#
# A quick script to dump an overview of all the open issues in all my github projects
#
require 'octokit'
require 'awesome_print'
require 'rainbow'
@bergie
bergie / README.md
Created May 18, 2011 11:33
Falsy Values tutorials
@rdp
rdp / Go2.java
Created May 23, 2011 22:18
example file that seems to get slower when used with hotspot JVM. Us
/* use like
$ javac Go2.java
$ java -client Go2
$ java -server Go2
*/
public class Go2 {
@chrishamant
chrishamant / guestbook.go
Created July 11, 2011 13:30
Go Lang app engine sample
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package guestbook
import (
"http"
"io"
"os"
@mnot
mnot / sun buffering goes wild
Created August 11, 2011 02:32
The raw HTTP of a GET response from http://www.sun.com/ (before the Oracle acquisition), reproduced here in its entirety.
HTTP/1.1 200 OK
Server: Sun-Java-System-Web-Server/7.0
Date: Mon, 07 Dec 2009 07:25:34 GMT
P3p: policyref="http://www.sun.com/p3p/Sun_P3P_Policy.xml", CP="CAO DSP COR CUR ADMa DEVa TAIa PSAa PSDa CONi TELi OUR SAMi PUBi IND PHY ONL PUR COM NAV INT DEM CNT STA POL PRE GOV"
Cache-control: public
Set-cookie: JROUTE=W2VMz2yu926eYGvP; Path=/
X-powered-by: JSP/2.1
Set-cookie: JSESSIONID=80765ae114eab08df95a11208c62; Path=/
Content-type: text/html;charset=UTF-8
Via: 1.1 https-www
@alexalemi
alexalemi / twittercompress.py
Created August 31, 2011 03:24
Twitter Compression
""" A script to attempt the compression of written english
to the chinese character set """
import os
from collections import OrderedDict
from math import log
import itertools
from collections import Counter
@fennb
fennb / gist:1283573
Created October 13, 2011 06:35
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
require 'jruby'
module Serialize
def self.serialize(obj)
baos = java.io.ByteArrayOutputStream.new
oos = java.io.ObjectOutputStream.new(baos)
oos.write_object(JRuby.reference(obj))
oos.close