This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
set :rails_env, "production" | |
set :passenger_port, 9292 | |
set :passenger_cmd, "#{bundle_cmd} exec passenger" | |
namespace :deploy do | |
task :start, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{passenger_cmd} start -e #{rails_env} -p #{passenger_port} -d" | |
end | |
task :stop, :roles => :app, :except => { :no_release => true } do |
<% [:notice, :error, :alert].each do |level| %> | |
<% unless flash[level].blank? %> | |
<div class="alert-message <%= flash_class(level) %>"> | |
<a class="close" href="#">×</a> | |
<%= content_tag :p, flash[level] %> | |
</div> | |
<% end %> | |
<% end %> |
#!/bin/env ruby | |
# lazy hack from Robert Klemme | |
module Memory | |
# sizes are guessed, I was too lazy to look | |
# them up and then they are also platform | |
# dependent | |
REF_SIZE = 4 # ? | |
OBJ_OVERHEAD = 4 # ? |
#! /usr/bin/python | |
import Image | |
#_______________________________________________________load image/create 'canvas' | |
source = Image.open("test26.jpg") | |
img = source.load() | |
print source.format |
Rails as it has never been before :) | |
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring. | |
Note: Some of them are collected from different online resources/posts/blogs with some tweaks. |
require "spec_helper" | |
describe ExampleController do | |
context "GET #index" do | |
let(:resources) { FactoryGirl.create_list(:resource) } | |
before do | |
get :index | |
end |