Skip to content

Instantly share code, notes, and snippets.

Avatar

Max Masnick masnick

View GitHub Profile
@silviorelli
silviorelli / config.ru
Created Apr 8, 2011
config.ru for using POW Rack server with Rails 2
View config.ru
# Rails.root/config.ru
require "./config/environment"
run ActionController::Dispatcher.new
View statused_worker.rb
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 Mar 14, 2012
Hide/Show apps from Lion's dock (shell command)
View gist:2037831
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
View gist:48774
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
View gist:4568041
for f in *.yaml; do mv $f `basename $f .yaml`.yml; done;
View generate_tags.rb
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 Aug 9, 2012
Use Twitter directly in your Google Doc, so no one will ever blame you for being social
View Tweetsheets
var CONSUMER_KEY = "<< YOUR KEY HERE >>";
var CONSUMER_SECRET = "<< YOUR SECRET HERE >>";
function getConsumerKey() {
return CONSUMER_KEY;
}
function getConsumerSecret() {
return CONSUMER_SECRET;
}
@prenagha
prenagha / Copy to iPhone.scpt
Last active Jul 7, 2019
Launchbar integration applescript for command-c http://danilo.to/command-c/
View Copy to iPhone.scpt
--
-- Source: Padraic Renaghan prenagha@renaghan.com https://gist.github.com/prenagha/8372844
--
-- launchbar integration applescript for command-c
-- http://danilo.to/command-c/
--
-- set the variable "theDevice" below as needed to the device name you want to send to
-- Put script in Launchbar actions folder
-- ~/Library/Application Support/Launchbar/Actions
--
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011
The Changelogs for Rails 3.1 Beta 1
View rails_3_1_rc4_changes.md

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 Aug 12, 2012
Password manager without a password manager
View gist:3334991

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