Skip to content

Instantly share code, notes, and snippets.

View rhodee's full-sized avatar
💭
hi.

Denis rhodee

💭
hi.
  • Austin, TX
View GitHub Profile

Keybase proof

I hereby claim:

  • I am rhodee on github.
  • I am rhodee (https://keybase.io/rhodee) on keybase.
  • I have a public key ASBui_bwfQNNMp65XpDZMhNvmZ7RfLmDyEzahkdT3gjRvgo

To claim this, I am signing this object:

javascript:(function() {var e = document.getElementById('pull_request_body'); if (e) {e.value += '#### What\'s this PR do?\n\n\n#### Where should the reviewer start?\n\n\n#### How should this be manually tested?\n\n\n#### Any background context you want to provide?\n\n\n#### What are the relevant tickets?\n\n\n#### Screenshots (if appropriate):\n\n\n![alt text](http://placekitten.com/g/400/200 "Image Here")\n\n\n#### Questions:\n\n\n'}})();
@rhodee
rhodee / configurator.rb
Last active August 29, 2015 13:57
A tested, dynamic approach to building configuration objects on the fly
class Configurator
def self.configure(&block)
configuration ||= new
configuration.instance_eval(&block)
return configuration
end
def respond_to_missing?(method_name, include_private = false)
super unless self.instance_variables.include?(convert_method_to_symbol(method_name))
@rhodee
rhodee / pre-commit
Last active August 29, 2015 13:57
Ideas for a pre-commit hook. Welcome.
#!/usr/bin/env ruby
# Drop in .git/hooks
# Make executable and get back to werk.
# Stash files not to be committed
system('git stash -q --keep-index')
# check for rake
rake_available = system('bundle list | grep rake > /dev/null')
@rhodee
rhodee / _test.rb
Created January 3, 2013 03:26 — forked from jcoglan/_test.rb
$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do
@rhodee
rhodee / friendly_urls.markdown
Created November 18, 2012 03:49 — forked from cdmwebs/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@rhodee
rhodee / database.yml.example mysql2
Created July 23, 2012 13:45 — forked from erichurst/database.yml.example mysql2
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
defaults: &defaults
adapter: mysql2 #or mysql