Skip to content

Instantly share code, notes, and snippets.

View yuhunglin's full-sized avatar

Yu-Hung Lin yuhunglin

  • Chaos Monkeys United
  • Monkey Island
View GitHub Profile
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@mrinalwadhwa
mrinalwadhwa / make_osx_vagrant_box.sh
Created June 19, 2013 18:47
Create an OSX Vagrant Box
# Create an OSX Vagrant Box
# Run this script from the directory that has InstallESD.dmg in it
# Get InstallESD.dmg using the method described on this link
# http://hints.macworld.com/article.php?story=20110831105634716
# Setup a vagrant box
# http://garylarizza.com/blog/2013/01/20/using-veewee-to-build-os-x-vms/
git clone git://github.com/jedi4ever/veewee.git
@Chrisedmo
Chrisedmo / Mountain Lion tweaks
Created July 30, 2012 14:30
Mountain Lion tweaks (under the hood)
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MathBook Pro"
scutil --set HostName "MathBook Pro"
scutil --set LocalHostName "MathBook-Pro"
@mperham
mperham / after.rb
Created July 4, 2012 19:30
Thread-friendly shared connection
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection }
end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection