Skip to content

Instantly share code, notes, and snippets.

View phirefly's full-sized avatar

Raphael (Raphy) Villas phirefly

View GitHub Profile
@phirefly
phirefly / SolarizedLight2Bd
Last active December 18, 2015 09:39
Customized sublime theme based off of Solarized (light)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Solarized (light)</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@phirefly
phirefly / gist:5409266
Created April 18, 2013 01:38
Sublime: User prefs
{
"color_scheme": "Packages/Color Scheme - Default/LAZY2Bd.tmTheme",
"font_face": "Anonymous Pro",
"font_size": 16.0,
"highlight_line": true,
"ignored_packages":
[
],
"line_padding_top": 3,
"tab_size": 2,
@phirefly
phirefly / LAZY2Bd
Last active December 15, 2015 21:18
Customized sublime theme based off of LAZY
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Raphael Villas</string>
<key>name</key>
<string>LAZY2Bd</string>
<key>settings</key>
<array>
@phirefly
phirefly / gist:991979
Created May 25, 2011 21:04
selenium error
Exception `LoadError' at /Users/rv/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:1231 - no such file to load -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/rv/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:1240 - no such file to load -- rubygems/defaults/ruby
Exception `LoadError' at /Users/rv/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -- selenium-webdriver
Exception `LoadError' at /Users/rv/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -- Win32API
Exception `LoadError' at /Users/rv/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no such file to load -- Win32API
Exception `NoMethodError' at /Users/rv/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/rational.rb:82 - undefined method `gcd' for Rational(1, 2):Rational
Exception `LoadError' at /Users/rv/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/
# /lib/tasks/mongo.rake
namespace :db do
namespace :test do
task :prepare do
# Stub out for MongoDB
end
end
end
# config/initializers/mongodb.rb
db_config = YAML::load(File.read(File.join(Rails.root, "/config/database.yml")))
if db_config[Rails.env] &&
db_config[Rails.env]['adapter'] == 'mongodb'
mongo = db_config[Rails.env]
MongoMapper.connection = Mongo::Connection.new(mongo['hostname'])
MongoMapper.database = mongo['database']
end
class ModelName
include MongoMapper::Document
key :key, String
timestamps!
# Validations :::::::::::::::::::::::::::::::::::::::::::::::::::::
# validates_presence_of :attribute