Skip to content

Instantly share code, notes, and snippets.

Mike Pence mikepence

  • Florida
View GitHub Profile
brianpetro / rails-4-new-options
Created Apr 28, 2015
Command line options for ` rails new --help ` (Rails 4.2). Useful for planning new Ruby on Rails app. 'Where can I find options for “rails new” command?'
View rails-4-new-options
Because I couldn't find these with a quick Google search on 28 April 2015:
rails new APP_PATH [options]
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/brian/.rvm/rubies/ruby-2.2.0/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile
litch / Gemfile
Created Feb 24, 2013
Ruby 2.0.0 installation with RVM and running on heroku. RVM instructions sourced from: A quick comparison of Ruby 2.0.0 performance loading rails can be found at my blog:
View Gemfile
source ''
ruby "2.0.0"
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
brianknapp / create_request.rb
Created Feb 12, 2013
This is sample code for a CreateRequest object. I don't know exactly what this is supposed to do, so I'm going to make this up as I go. Hopefully it is helpful to show multiple jacks on one action.
View create_request.rb
class CreateRequest
def initialize request_jack, notification_jack, payment_jack
@request_jack = request_jack
@notification_jack = notification_jack
@payment_jack = payment_jack
def execute input
unless input.has_shape? user_id: Fixnum, text: String, amount: Float, who_to_notify: Fixnum
ambethia / life.rb
Last active Sep 28, 2015
My implementation of Conway's Game of Life
View life.rb
# Run this:
# ruby < <(curl -s
require 'curses'
class Life
extend Curses
mislav / gist:938183
Created Apr 23, 2011
Faraday SSL example
View gist:938183
connection ='') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
# same as above, short form:
connection = ''
connection.get '/posts'
igrigorik / webapp.rb
Created Nov 13, 2010
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
View webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
You can’t perform that action at this time.