Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / wordcount.clj
Created January 13, 2012 19:45
Reliable word-count topology
(ns topologies.core
(:import [backtype.storm StormSubmitter LocalCluster])
(:require [clojure.test :as test])
(:use [backtype.storm clojure config])
(:gen-class))
(def id-count (atom 0)) ;; tuple counter for debugging -- something to make ids out of
(defspout sentence-spout ["sentence"]
@sgonyea
sgonyea / exportCookies-monkey_patch_edition.rb
Created November 22, 2011 05:57
MacRuby script to export Safari 5.1 cookies to a human-readable format
#!/usr/bin/env macruby
require 'csv'
framework 'Foundation'
CSV_Headers = %w[domain path expiresDate name value].to_csv
class NSHTTPCookie
def to_csv
[domain, path, expiresDate, name, value].to_csv
end
@dahlia
dahlia / lisp.rb
Created September 2, 2010 07:52
30 minutes Lisp in Ruby
# 30 minutes Lisp in Ruby
# Hong Minhee <http://dahlia.kr/>
#
# This Lisp implementation does not provide a s-expression reader.
# Instead, it uses Ruby syntax like following code:
#
# [:def, :factorial,
# [:lambda, [:n],
# [:if, [:"=", :n, 1],
# 1,
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@abhin4v
abhin4v / Fibonacci.java
Created November 24, 2009 18:46
Python-style Generator in Java
package net.abhinavsarkar.util;
/**
* A (infinite) Fibonacci number generator.
*
* @author Abhinav Sarkar
*/
public class Fibonacci extends Generator<Integer> {