Skip to content

Instantly share code, notes, and snippets.

View masnick's full-sized avatar

Max Masnick masnick

View GitHub Profile
@silviorelli
silviorelli / config.ru
Created April 8, 2011 10:30
config.ru for using POW Rack server with Rails 2
# Rails.root/config.ru
require "./config/environment"
run ActionController::Dispatcher.new
require "digest/md5"
require "resque-retry"
require "resque-loner"
#
# Statused Worker Example:
#
# class MyStatusedWorker < StatusedWorker
# def self.job_identity_arguments(user_id, credit_card_number, attributes = {})
# [user_id]
@schrader
schrader / gist:2037831
Created March 14, 2012 16:52
Hide/Show apps from Lion's dock (shell command)
Hide Application from Dock:
defaults write /Applications/Application.app/Contents/Info LSUIElement 1
Show Application in Dock:
defaults write /Applications/Application.app/Contents/Info LSUIElement 0
cd /tmp
git clone git://git.kernel.org/pub/scm/git/git.git
cd git
git checkout v`git --version | awk '{print $3}'`
cp contrib/completion/git-completion.bash ~/.git-completion.bash
cd ~
rm -rf /tmp/git
echo -e "source ~/.git-completion.bash" >> .profile
for f in *.yaml; do mv $f `basename $f .yaml`.yml; done;
namespace :tags do
task :generate do
puts 'Generating tags...'
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.read_posts('')
@johannesnagl
johannesnagl / Tweetsheets
Created August 9, 2012 10:25
Use Twitter directly in your Google Doc, so no one will ever blame you for being social
var CONSUMER_KEY = "<< YOUR KEY HERE >>";
var CONSUMER_SECRET = "<< YOUR SECRET HERE >>";
function getConsumerKey() {
return CONSUMER_KEY;
}
function getConsumerSecret() {
return CONSUMER_SECRET;
}
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@jaseg
jaseg / gist:3334991
Created August 12, 2012 22:32
Password manager without a password manager

Prelude

Since password managers are big and complicated and I currently am pretty bored since I am sitting in a car for a few hours, here is a simple algorithm to generate resource-specific, unique passwords using a master password and no password database.

WARNING

As pointed out here: http://news.ycombinator.com/item?id=4374888 this method is broken.

Usage

A Beginner's Hip Hop Playlist

Edit: After some constructive feedback on hacker news, I think that it's worth mentioning that this playlist is very skewed towards recent material, although I've included some essentials from the past.

I think that hip hop is one of the most, if not the most, misunderstood genres of music. In this playlist, rather than focusing on one artist or one type of hip hop, I tried to give examples of a bunch of different artists with songs ranging from the early 90's all the way up until 2017. The songs are in no particular order and the sounds cover a very broad spectrum. Some of them are pretty damn explicit, so I wouldn't necessarily throw this playlist on if there are kids around. I provided the lyrics to each song, the sub-genre that I'd put the artist in (very rough), and a brief description. This playlist is not by any means meant to be comprehensive and in many cases doesn't necessarily represent the artist's "best" song, but instead aims at exposing you to some of my fa