Skip to content

Instantly share code, notes, and snippets.

View juniovitorino's full-sized avatar
🏠
Working from home

Junio Vitorino juniovitorino

🏠
Working from home
View GitHub Profile
@jphpsf
jphpsf / application.html.erb
Created July 16, 2011 05:48
Reuse of the Rails Admin layout for the whole application
# app/views/layouts/application.html.erb
<% head_style 'styles' %>
<% head_javascript 'application' %>
<%= render :file => 'layouts/rails_admin/main' %>
filenames = Dir.glob(Rails.application.paths.app.models.collect { |path| File.join(path, "**/*.rb") })
$class_names = []
filenames.each do |filename|
$class_names += File.read(filename).scan(/class ([\w\d_\-:]+)/).flatten
end
@rafaelsachetto
rafaelsachetto / gist:758655
Created December 29, 2010 15:53
Dica para ambiente usando RVM (pushd/popd)
# hack to rvm invoke .rvmrc
cd_with_pushd()
{
if [ $# -eq 0 ]; then
DIR="${HOME}"
else
DIR="$1"
fi
pushd "${DIR}"
@ghickman
ghickman / _contact.rb
Created July 4, 2010 17:23
Jekyll Contact Form with Sinatra
require 'rubygems'
require 'sinatra'
require 'pony'
require 'haml'
set :haml, {:format => :html5}
set :public, File.dirname(__FILE__)
set :views, File.dirname(__FILE__)
# Create the page class and give it a title of Contact for the layout
@mrrooijen
mrrooijen / carrierwave_tasks.rb
Created June 2, 2010 00:27
Rake Tasks for Carrier Wave for reprocessing versions.
##
# CarrierWave Amazon S3 File Reprocessor Rake Task
#
# Written (specifically) for:
# - CarrierWave
# - Ruby on Rails 3
# - Amazon S3
#
# Works with:
# - Any server of which you have write-permissions in the Rails.root/tmp directory