Skip to content

Instantly share code, notes, and snippets.

View beathyate's full-sized avatar

Gustavo Beathyate beathyate

View GitHub Profile
# Gemfile
gem "puma"
# Procfile
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb
# add to config block config/environments/production.rb
config.threadsafe!
# get rid of NewRelic after_fork code, if you were doing this:
@beathyate
beathyate / game.rb
Created September 27, 2011 19:11
This is the rspec file of my project
class Game
attr_accessor :grid
def initialize
@grid = Hash.new
@moves = 0
9.times { |time| grid[time+1] = nil }
end
def mark(space, marker)
# _plugins/haml_converter.rb
module Jekyll
class HamlConverter < Converter
safe true
def setup
return if @setup
require 'haml'
@setup = true
require 'openid/store/interface'
module OpenID::Store
class Association
include Mongoid::Document
field :secret, :type => Binary
def from_record
OpenID::Association.new(handle, secret.to_s, issued, lifetime, assoc_type)
end
@beathyate
beathyate / omg.rb
Created March 16, 2010 13:02 — forked from wycats/omg.rb
require ".bundle/environment"
Bundler.setup
require "action_controller/railtie"
class FooController < ActionController::Base
def bar
self.response_body = "HELLO"
end
end
# rails project_name -m http://gist.github.com/gists/291935.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
/*
html5doctor.com Reset Stylesheet
v1.4
2009-07-27
Author: Richard Clark - http://richclarkdesign.com
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production: