View application.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<%= inline_js 'application.js' %> | |
<%= inline_css 'application.css' %> | |
</head> | |
<body> | |
</body> | |
</html> |
View time.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/time.rb | |
module ActiveRecord | |
module ConnectionAdapters | |
module Quoting | |
alias_method :old_quoted_date, :quoted_date | |
alias_method :old_quote, :quote | |
# In Rails 3.2 quoted_date does not have the column argument | |
def quoted_date(value, column = nil) | |
# Calls original method ; default in Rails 3.2 |
View gist:a81bac9c0b8e4784f93f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONFIGURE_OPTS="--with-readline-dir=/usr/local/Cellar/readline/6.3.8/" rbenv install 2.1.5 |
View gist:de4f60bcdaa8dce08095
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Xcode has been installed with the full version (don't forget to accept the licence) | |
# Ruby has been installed with rbenv | |
# Not needed for recent versions of Nokogiri | |
#brew install libxml2 libxslt | |
#brew link --force libxml2 libxslt | |
brew tap homebrew/dupes | |
brew install --force libiconv | |
brew link --force libiconv |
View gist:9bee80c203db6e2f3e4d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext/object/try.rb' | |
trap("INT") { puts "Exiting..."; exit } | |
FILENAME = ARGV[0] | |
if FILENAME.nil? || FILENAME.empty? | |
puts 'Usage:' | |
puts 'ruby parse_gemfile.rb path-to-your-Gemfile' | |
exit |
View gist:9250039
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install nokogiri -- --with-xml2-include=/opt/boxen/homebrew/Cellar/libxml2/2.9.1/includlibxml2/ --with-xml2-lib=/opt/boxen/homebrew/Cellar/libxml2/2.9.1/lib/ |
View active_model_errors.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
ActiveModel::Errors.module_eval do | |
def as_json options = nil | |
@api_errors | |
end | |
def initialize(base) | |
@base = base | |
@messages = ActiveSupport::OrderedHash.new | |
@api_errors = [] |
View parse_gemfile.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext/object/try.rb' | |
trap("INT") { puts "Exiting..."; exit } | |
FILENAME = ARGV[0] | |
if FILENAME.nil? || FILENAME.empty? | |
puts 'Usage:' | |
puts 'ruby parse_gemfile.rb path-to-your-Gemfile' | |
exit |
View config.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by PostgreSQL configure 9.1.4, which was | |
generated by GNU Autoconf 2.63. Invocation command line was | |
$ ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.4 --datadir=/usr/local/Cellar/postgresql/9.1.4/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.1.4/share/doc/postgresql --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-ossp-uuid --with-python --with-perl ARCHFLAGS='-arch x86_64' | |
## --------- ## | |
## Platform. ## |
View gist:498196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommandLineApp < BasicApp | |
def open_url(url) | |
if RUBY_PLATFORM =~ /darwin/ | |
`open #{url}` | |
elsif RUBY_PLATFORM =~ /linux/ && `which xdg-open` != "" | |
`xdg-open #{url}` | |
elsif RUBY_PLATFORM =~ /mswin|mingw|bccwin|wince|em/ | |
`start #{url}` | |
else | |
puts "Please open #{@authorize_url + request_token.token} in a web browser. " |