Skip to content

Instantly share code, notes, and snippets.

View blakejakopovic's full-sized avatar

Blake Jakopovic blakejakopovic

View GitHub Profile
@gus
gus / index.txt
Created November 30, 2009 21:55 — forked from toothrot/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@kneath
kneath / ._what.md
Created December 4, 2009 18:23
Badass git pull alias (up) to show commit log that just got pulled in addition to changes

Badass git pull alternative

Add this little snippet to your ~/.gitconfig and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Scott Chacon and Ryan Tomayko basically figured out how to do this and I am stealing all of the credit.

@ghoseb
ghoseb / ns-cheatsheet.clj
Last active April 11, 2024 05:28 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
gemcutter => redis downloads spec
=================================
keys
----
downloads => global counter for all gem downloads
downloads:today => sorted set for downloads from today
downloads:rubygem:rails => counter for all rails downloads
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads
task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
task :migrations => [:push, :off, :migrate, :restart, :on, :tag]
task :rollback => [:off, :push_previous, :restart, :on]
task :push do
puts 'Deploying site to Heroku ...'
puts `git push heroku`
end
@koenbollen
koenbollen / punch.py
Created July 5, 2010 19:10
Proof of Concept: UDP Hole Punching
#!/usr/bin/env python
#
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
#
# This is the client.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@mxgrn
mxgrn / gist:663933
Created November 5, 2010 10:24
Git's pre-commit hook to remove trailing whitespaces/tabs
#!/bin/sh
#
# This will abort "git commit" and remove the trailing whitespaces from the files to be committed.
# Simply repeating the last "git commit" command will do the commit then.
#
# Put this into .git/hooks/pre-commit, and chmod +x it.
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
@creationix
creationix / chatServer.js
Created November 19, 2010 20:47
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
@ruel
ruel / infb.py
Created November 26, 2010 12:07
A script to scrape information from your facebook friends.
#!/usr/bin/python
'''
InFB - Information Facebook
Usage: infb.py user@domain.tld password
http://ruel.me
Copyright (c) 2011, Ruel Pagayon
All rights reserved.