Skip to content

Instantly share code, notes, and snippets.

@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active August 5, 2025 08:10
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss
@jmyrland
jmyrland / nodejs.spec
Created July 19, 2012 12:23 — forked from splaice/nodejs.spec
RPM spec file for node
%define ver 0.8.2
%define rel 1
%define jobs 2
Name: nodejs
Version: %{ver}
Release: %{rel}
Summary: Node's goal is to provide an easy way to build scalable network programs.
Group: Applications/Internet
License: Copyright Joyent, Inc. and other Node contributors.
@aphyr
aphyr / gist:3200829
Created July 29, 2012 18:29
Node.js message passing test
var cluster = require('cluster');
var m = 10000000;
function bounce(msg, out) {
if (msg < m) {
out.send(msg + 1);
return null;
} else {
console.log("Finished with", msg);
@aphyr
aphyr / gist:3200862
Created July 29, 2012 18:30
Clojure message passing test
(ns messagepassing.core)
(import [java.util.concurrent LinkedTransferQueue])
(def m 10000000)
(defn queue-test []
(defn bounce [in out m]
(let [value (.take in)]
(if (< value m)
(do
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@leesmith
leesmith / team-workflow.md
Created August 29, 2012 16:18
Git workflow for agile teams

Mar 2nd, 2009

An efficient workflow for developers in Agile teams that handles features and bugs while keeping a clean and sane history.

At Hashrocket we use git both internally and in our Agile mentoring and training. Git gives us the flexibility to design a version control workflow that meets the needs of either a fully Agile team or a team

@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@jpanganiban
jpanganiban / gist:3826762
Created October 3, 2012 12:55
Unleash the Cracken
import requests
from bs4 import BeautifulSoup
url = 'http://polli.me/events.php?eid=%s&iids=%s'
while True:
response = requests.get('http://polli.me/events.php?ec=605061973')
soup = BeautifulSoup(response.text)
@jamesflorentino
jamesflorentino / class.js
Created November 27, 2012 20:00
ES5, AMD and CommonJS compliant Class module
/**
* ES5 compliant AMD/CommonJS Class Module
* Copyright (c) 2012 James Florentino
*
* Distributed under the terms of the MIT license.
* http://www.opensource.org/licenses/mit-license.html
*
* Derived from John Resig's Simple Prototype Inheritance http://ejohn.org/
* UMD compatible
*
@zh
zh / rails-install.sh
Created November 29, 2012 14:26
New OS X machine setup for Ruby/Rails development
#!/bin/sh
# Purpose: setup new OS X machine for Ruby/Rails development
# Pre-Requirements: GCC (https://github.com/kennethreitz/osx-gcc-installer)
# Usage: bash < <(curl -fsSkL https://raw.github.com/gist/4169434/rails-install.sh)
RUBY_VERSION="1.9.3-p327"
if [[ `which gcc` == "" ]]; then
echo "[E] Please install GCC first. Exiting."
exit 1