Skip to content

Instantly share code, notes, and snippets.

View rujmah's full-sized avatar
👨‍🚀
Looking to the future

Robin Mayfield rujmah

👨‍🚀
Looking to the future
View GitHub Profile
# rubygems DNS is temporarily down, put this into your /etc/hosts to install gems,
# but don't forget to remove the entries once their DNS is back up again
72.4.120.124 rubygems.org
207.171.181.231 production.s3.rubygems.org
216.137.45.24 production.cf.rubygems.org
@rujmah
rujmah / UbuntuRVMCheatsheet.md
Created March 29, 2012 15:14
Ubuntu + RVM setup Cheatsheet
@rujmah
rujmah / basicmongoidrailswizardscript.md
Created April 3, 2012 16:15
Basic Mongoid Rails app call (railswizard.org)
@rujmah
rujmah / authmongoid.md
Created April 17, 2012 16:35
Mongoid implementation for authentication from scratch

Mongoid implementation of Ryan Bates authentication-from-scratch lesson on Railscasts.

Also uses 'username' rather than 'email' for validation

Commandline:

rails new authmongoid -O
cd authmongoid/

Gemfile:

@rujmah
rujmah / Rails MongoMapper Template.rb
Created May 21, 2012 09:56 — forked from banker/Rails MongoMapper Template.rb
A Rails Template for using MongoMapper
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
#
# To use:
# rails project_name -m http://gist.github.com/gists/219223.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
@rujmah
rujmah / gist:2761591
Created May 21, 2012 09:57 — forked from jasonmccay/gist:1145512
mongoid config
defaults: &defaults
autocreate_indexes: true
max_retries_on_connection_failure: 3
allow_dynamic_fields: false
development:
host: localhost
database: taq_development
@rujmah
rujmah / mongoid_tags.rb
Created May 21, 2012 09:58
Mongoid_tags
class Tag
include Mongoid::Document
field :name
embedded_in :taggable, polymorphic: true
end
class Category
include Mongoid::Document
embeds_many :tags, class_name: "Tag", as: :taggable
def tag_list
@rujmah
rujmah / paperapptrail_with_heroku.md
Created May 25, 2012 13:59
Setup Papertrailapp to view Heroku app logs
  • login to paperapptrail.com and create a new system
  • make a note of the port number - e.g. logs.papertrailapp.com:12345
  • in your heroku dir enter the following:
heroku drains:add syslog://logs.papertrailapp.com:[port number]

Ta-dah!

@rujmah
rujmah / mongoid_like.md
Created June 19, 2012 10:33
Mongoid 'LIKE'

Mongoid LIKE

Tag.where({title: /th/})
@rujmah
rujmah / gist:2955196
Created June 19, 2012 16:43
Generating tags with js-TokenInput and Mongoid in Rails