Skip to content

Instantly share code, notes, and snippets.

View rafaelfranca's full-sized avatar
🚆
Focused on Rails

Rafael Mendonça França rafaelfranca

🚆
Focused on Rails
View GitHub Profile
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@lucasmazza
lucasmazza / documentup.sh
Created February 2, 2012 23:52
Using documentup with a local README.
# gem install bcat
curl -X POST --data-urlencode content@README.md http://documentup.com/compiled | bcat
@rondy
rondy / gist:2256526
Created March 30, 2012 22:32
Prompt branch name to deploy on Capistrano (OOP way)
namespace :deploy do
task :set_branch do
set :branch, prompt_branch_name
end
before "deploy:update" , "deploy:set_branch"
end
def prompt_branch_name
BranchedDeploy.new.prompt
end
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@apotonick
apotonick / pure_ruby.rb
Created May 7, 2012 06:01
Cells in Sinatra, Webmachine, Love
require 'cell/base'
class FakeRoutes # should be sinatra's url helper instance
def url_for(*)
end
def named_routes # required due to a fucking stupid line in AbstractController::UrlFor#25 (3.2.3)
# super - _routes.named_routes.helper_names
Object.new.instance_eval do
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@mislav
mislav / backfill-releases.sh
Created February 5, 2014 17:37
Script to migrate releases from CHANGELOG.md to GitHub Releases
#!/bin/bash
# Usage: OAUTH_TOKEN="..." backfill-releases CHANGELOG.md [<project-title>]
set -e
log="${1?}"
project_name="${2}"
repo="$(git config remote.origin.url | grep -oE 'github\.com[/:][^/]+/[^/]+' | sed 's/\.git$//' | cut -d/ -f2-3)"
[ -n "${project_name}" ] || project_name="${repo#*/}"