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:
# Add to config/routes.rb | |
# post 'incoming_emails' => 'incoming_emails#create' | |
require 'mail' | |
class IncomingEmailsController < ApplicationController | |
skip_before_filter :verify_authenticity_token, only: :create | |
def create | |
mail = Mail.new(params[:message]) |
echo Entering vagrant... Ctrl-C to abort | |
sleep 1 | |
cd ~/ | |
vagrant up && vagrant ssh && exit |
# set env FULL_STACKTRACE=1 for full stacktrace | |
# set env DEBUG_LOG=1 to turn this on (default off) | |
if defined?(ActiveRecord::LogSubscriber) | |
module ActiveRecord | |
class LogSubscriber | |
def sql(event) | |
self.class.runtime += event.duration | |
return unless logger.debug? |
Hash.class_eval do | |
# returns an array of values | |
def csspath(path, options = {}) | |
Nokogiri::HTML(self.to_xml).css(path.dasherize).collect {|element| | |
result = Hash.from_xml(element.to_s) | |
(options[:include_keys] ? result : result.values.first) | |
} | |
end | |
end |
# usage: [proxy port] [target port] | |
socat -v -d -d -d TCP4-LISTEN:$1,reuseaddr,retry,fork TCP4:localhost:$2,retry |
match "/assets/*path" => lambda {|env| | |
path = env['REQUEST_PATH'] | |
Rails.cache.fetch("v9.assets.#{path}", expires_in: 1.hour) do | |
if found = Rails.application.assets.find_asset(File.basename(path)) | |
[302, { 'Location' => "#{Rails.application.config.action_controller.asset_host}#{File.dirname(path)}/#{found.digest_path}" }, []] | |
else | |
[404, {}, []] | |
end | |
end | |
}, via: [:get] # /lambda |
// http://stackoverflow.com/a/8809472/136558 | |
function generateUUID(){ | |
var d = (window.performance && window.performance.now && window.performance.now()) || | |
(Date.now && Date.now()) || | |
(new Date().getTime()); | |
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = (d + Math.random()*16)%16 | 0; | |
d = Math.floor(d/16); | |
return (c=='x' ? r : (r&0x7|0x8)).toString(16); | |
}); |
I hereby claim:
To claim this, I am signing this object:
(function() { | |
function direct_upload() { | |
console.log('direct_upload', this); | |
var ele = this; | |
new DirectUpload({ | |
file_element: ele, | |
onProgress: function(percent, message) { | |
console.log('onProgress', arguments); | |
}, | |
onError: function(status) { |