Skip to content

Instantly share code, notes, and snippets.

@brunoadacosta
brunoadacosta / gist:3355122
Created August 15, 2012 02:36 — forked from tapajos/gist:3355004
trucate logs
#!/bin/bash
cd $PROJECT_PATH
for i in $(find */log/*.log); do
echo "" > $i
done
@brunoadacosta
brunoadacosta / Folder Preferences
Created August 7, 2012 15:25 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@brunoadacosta
brunoadacosta / after.rb
Created July 6, 2012 18:54 — forked from mperham/after.rb
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
@brunoadacosta
brunoadacosta / mountain-lion-brew-setup.markdown
Created June 18, 2012 14:38 — forked from akitaonrails/mountain-lion-brew-setup.markdown
Get Mountain Lion Preview 4 and Homebrew to Be Happy

Get Mountain Lion Preview 4 and Homebrew to Be Happy

1) Install XCode 4.5 Developer Preview into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@brunoadacosta
brunoadacosta / gist:1561196
Created January 4, 2012 17:53 — forked from ferbass/gist:1010989
How to remove xcode
sudo /Developer/Library/uninstall-devtools --mode=all