Skip to content

Instantly share code, notes, and snippets.

@salizzar
salizzar / gist:e63ca53de0d63e433779
Last active August 29, 2015 14:06
Processing CSV files more fast with Fibers + EM.defer
require 'bundler/setup'
require 'fiber'
require 'csv'
require 'pp'
require 'eventmachine'
def a_slow_api_call(row)
sleep 0.3
row.collect(&:to_i).inject(&:+)
@jbenet
jbenet / simple-git-branching-model.md
Last active July 21, 2025 21:02
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@squiter
squiter / gist:5462091
Created April 25, 2013 18:46
Your friend is a gay? Spam him with this AppleScript to send multiple messages to your gay friend using Adium! Remeber to export this script as App :P
tell application "Adium"
set eu to "your_email@here.com"
set gay to text returned of ¬
(display dialog ¬
"Quem é o Gay?" with title ¬
"Putz! Que viadão!" with icon stop ¬
default answer ¬
"" buttons {"Vai…"} ¬
default button 1)
tell account eu to set theChat to make new chat with contacts {contact gay} with new chat window
@moh-alsheikh
moh-alsheikh / gist:4044141
Last active October 12, 2015 14:58
Rails 3 Heroku Asset Pipeline Notes
ERROR ::
if you get the following error message when you try to open your app in Heroku ::
ActionView::Template::Error (images/apple-touch-icon-144x144-precomposed.png isn't precompiled):
===============================================================================================================
SOLUTION ::
@agnoster
agnoster / README.md
Last active December 4, 2025 22:26
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@artero
artero / launch_sublime_from_terminal.markdown
Last active October 13, 2025 19:00 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@justinxreese
justinxreese / download_pages.rb
Created April 12, 2011 15:44
Limit open threads in ruby
# Pretty simple solution to harness the capability of multithreading without running into problems
# caused by doing too many things at once.
# In this example, I was trying to download hundreds of web pages, but opening all those connections
# simultaneously caused a variety of errors
# Contains download_link(link,save_dir,save_name) to download and save webpages locally (irrelevant)
require 'download_page'
# keep the threads in here