Skip to content

Instantly share code, notes, and snippets.

View ChuckJHardy's full-sized avatar

Chuck J Hardy ChuckJHardy

View GitHub Profile
class Object
def method_missing(symbol, *args, &block)
if(args.nil?)
symbol.to_s
else
"#{symbol.to_s} #{args[0].to_s}"
end
end
end
@reu
reu / deploy.rb
Created November 6, 2010 12:41
Capistrano deploy recipe for database configuration
# Bundler Integration
require "bundler/capistrano"
# Application Settings
set :application, "yourapplicationname"
set :user, "serveruser"
set :deploy_to, "/home/#{user}/rails-applications/#{application}"
set :rails_env, "production"
set :use_sudo, false
set :keep_releases, 3
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

#!/usr/bin/env ruby
#
# A quick script to dump an overview of all the open issues in all my github projects
#
require 'octokit'
require 'awesome_print'
require 'rainbow'
@ChuckJHardy
ChuckJHardy / syntax_highlighting.py
Created September 24, 2011 01:01 — forked from mstarkman/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """
def on_load(self, view):
filename = view.file_name()
@kylewelsby
kylewelsby / install_global_guard.rb
Created December 7, 2011 12:32
Install Guard-RSpec to all RMV Rubies
#!/usr/bin/ruby env
guardfile = <<-'END'
def determine_rspec_version
if File.exist?("#{Dir.pwd}/spec/spec_helper.rb")
File.new("#{Dir.pwd}/spec/spec_helper.rb").read.include?("Spec::Runner") ? 1 : 2
elsif bundler?
# Allow RSpactor to be tested with RSpactor (bundle show inside a bundle exec)
ENV['BUNDLE_GEMFILE'] = "#{Dir.pwd}/Gemfile"
@tdegrunt
tdegrunt / canvastest.html
Created January 5, 2012 16:56
Working Canvastest for Batman
<!DOCTYPE html>
<html>
<head>
<title>Canvastest</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../lib/es5-shim.js"></script>
<script type="text/javascript" src="../lib/batman.js"></script>
<script type="text/javascript" src="../lib/batman.solo.js"></script>
<script type="text/javascript" src="../lib/coffee-script.js"></script>
@jaehess
jaehess / gist:1791066
Created February 10, 2012 17:21 — forked from ktusznio/gist:1790846
batman.js checkbox example
<!DOCTYPE html>
<html>
<head>
<title>Test App</title>
<script type="text/javascript" src="../lib/es5-shim.js"></script>
<script type="text/javascript" src="../lib/batman.js"></script>
<script type="text/javascript" src="../lib/batman.solo.js"></script>
<script type="text/javascript" src="../lib/extras/batman.rails.js"></script>
<script type="text/javascript" src="../lib/coffee-script.js"></script>
</head>
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

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

@doitian
doitian / sample.js.coffee
Created March 7, 2012 17:47
jasmine spec_helper sample
describe 'Render Helpers', ->
describeFunction prettyNumber, 'prettyNumber',
'23123456, {abbreviateBy: "M"}': '23M'
'123456, {abbreviateBy: "M"}': '0M'
'123123, {abbreviateBy: "k"}': '123k'
'123123, {abbreviateBy: "x"}': '123123'
'79296886': '79,296,886'
'7929.6886': '7,929.6886'
'"1.0000"': '1.0000'
'"1234.120"': '1,234.120'