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:
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
require 'rubygems' | |
require 'nokogiri' | |
class MyFilter | |
def ends_with set, ends | |
set.map { |x| x.to_s }.join.end_with? ends | |
end | |
end | |
doc = Nokogiri.XML(DATA) |
# monkey-patch https://github.com/ryanb/cancan/issues/327 | |
# put in Rails.root/config/initializers/cancan.rb | |
module CanCan | |
module ModelAdapters | |
class ActiveRecordAdapter | |
private | |
# fix nested imbrication | |
def merge_conditions(sql, conditions_hash, behavior) | |
if conditions_hash.blank? |
__or_fn = lambda do |*scopes| | |
where = [] | |
joins = [] | |
includes = [] | |
# for some reason, flatten is actually executing the scope | |
scopes = scopes[0] if scopes.size == 1 | |
scopes.each do |s| | |
w = [] | |
s.where_clauses.each do |where_clause| |
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
1.) Open any application | |
2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
3.) Release Power button | |
4.) Press and hold Home button Lightly | |
until screen returns to icon screen |
# drop this in a ruby file in my_rails_app/config/initializers | |
# restart your rails and app you're good to go! | |
class String | |
# remove middle from strings exceeding max length. | |
def ellipsize(options={}) | |
max = options[:max] || 40 | |
delimiter = options[:delimiter] || "..." | |
return self if self.size <= max | |
remainder = max - delimiter.size |
# Setup | |
# ===== | |
# | |
# Put this gist in Rails.root/config/initializers/cancan.rb | |
# Add Squeel to Gemfile, see https://github.com/ernie/squeel | |
# | |
# gem "squeel", "~> 0.9.3" | |
# | |
# Load Squeel hash and symbol extensions in squeel config initializer | |
# |
######################################### | |
### Install wget-ssl over ipkg's wget ### | |
######################################### | |
$ ipkg install -verbose_wget libidn # To get ipk URL | |
$ ipkg install -verbose_wget wget-ssl # To get ipk URL | |
$ /usr/syno/bin/wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/libidn_1.25-1_i686.ipk | |
$ /usr/syno/bin/wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/wget-ssl_1.12-2_i686.ipk | |
$ ipkg install libidn_1.25-1_i686.ipk | |
$ ipkg install wget-ssl_1.12-2_i686.ipk |
# Tested in Ruby 1.8.7 | |
class ParentClass | |
def call_private_good | |
# Private methods can only be called without an explicit receiver | |
private_test | |
end | |
def call_private_bad | |
# Calling a private method with an explicit receiver (self) will fail |