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:
/ In app/views/shared/ | |
#dev-badge | |
span= Rails.env | |
span It ain't production! |
1.9.3p194 :001 > 1==1?"one":"not one" | |
=> "one" | |
1.9.3p194 :002 > def one | |
1.9.3p194 :003?> 1 | |
1.9.3p194 :004?> end | |
=> nil | |
1.9.3p194 :005 > 1==one?"one":"not one" | |
SyntaxError: (irb):5: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' | |
1==one?"one":"not one" | |
1.9.3p194 :006 > 1==one ? "one":"not one" |
newpg=9.6.1 # set to new PG version number | |
oldpg=`pg_config --version | cut -d' ' -f2` | |
# PG 96. upgrades the readline to v7, which breaks anything linked against readline v6, like ruby via ruby-build. | |
# I *think* this should prevent it from installing v7. But if weird shit happens with various rubies, | |
# you'll have to reinstall them. | |
brew pin readline | |
# Stop current Postgres server | |
brew services stop postgresql |
require "spec_helper" | |
# :draper_with_helpers is necessary for the Draper objects | |
# to access real helpers, including URL helpers, in the spec. | |
describe MyDecorator, "#foo", :draper_with_helpers do | |
# This is necessary for the spec itself to use URL helpers | |
# like some_path(). | |
include Rails.application.routes.url_helpers |
def output name=((default=true); "caius") | |
puts "name: #{name.inspect}" | |
puts "default: #{default.inspect}" | |
end | |
output | |
# >> name: "caius" | |
# >> default: true | |
output "avdi" |
require "money" | |
class Decorator < BasicObject | |
undef_method :== | |
def initialize(component) | |
@component = component | |
end | |
def method_missing(name, *args, &block) |
If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
you may need to remove the previous version first. See: | |
https://github.com/mxcl/homebrew/issues/issue/2510 | |
To build plpython against a specific Python, set PYTHON prior to brewing: | |
PYTHON=/usr/local/bin/python brew install postgresql | |
See: | |
http://www.postgresql.org/docs/9.0/static/install-procedure.html | |
Update 2022: git checkout -p <other-branch>
is basically a shortcut for all this.
FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.
Example: You have a branch refactor
that is quite different from master
. You can't merge all of the
commits, or even every hunk in any single commit or master will break, but you have made a lot of
improvements there that you would like to bring over to master.
Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.