I hereby claim:
- I am synth on github.
- I am synth (https://keybase.io/synth) on keybase.
- I have a public key whose fingerprint is 21F3 1810 5912 3776 C65E B287 C33D 7669 E2A2 3723
To claim this, I am signing this object:
brew install ffmpeg ImageMagic mplayer gifsicle | |
# Option 1 | |
# http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality | |
ffmpeg -y -i yourmovie.mov -vf fps=10,scale=800:-1:flags=lanczos,palettegen palette.png | |
ffmpeg -i yourmovie.mov -i palette.png -filter_complex "fps=10,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" yourgif.gif | |
# Option 2 | |
# https://gist.github.com/dergachev/4627207 | |
ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif |
class AddFieldsToDelayedJobs < ActiveRecord::Migration | |
def change | |
add_column :delayed_jobs, :signature, :string | |
add_column :delayed_jobs, :args, :text | |
end | |
end |
module Foo | |
def print_hello | |
puts HELLO | |
end | |
end | |
class Bar | |
HELLO="hi there!" | |
include Foo | |
end |
I hereby claim:
To claim this, I am signing this object:
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
rails g model Post | |
rails g model Comment post_id:integer comment:string | |
rails c | |
p1 = Post.create | |
p2 = Post.create | |
p1.comments.create(comment: "1") | |
p1.comments.create(comment: "2") | |
p2.comments.create(comment: "3") | |
p2.comments.create(comment: "4") |
Shiva:recognize pete$ direnv status | |
direnv exec path /usr/local/Cellar/direnv/2.3.0/bin/direnv | |
DIRENV_CONFIG /Users/pete/.config/direnv | |
No .envrc loaded | |
Found RC path /Users/pete/work/recognize/.envrc | |
Found RC mtime 1399402756 | |
Found RC allowed true | |
Found RC allowPath /Users/pete/.config/direnv/allow/ff6c702ed5d2ddd9c0c25dc39583506d3fe5944604480c51eb7473287e7d7d48 |
def nice_errors(object, errors) | |
object.errors.each do |key| | |
error_obj = object.send(key) | |
if error_obj.kind_of?(Array) | |
errors[key] = {} | |
error_obj.each {|item| nice_errors(item, errors[key])} | |
elsif error_obj.kind_of?(ActiveRecord::Base) | |
errors[error_obj.id] = {} | |
nice_errors(error_obj, errors[error_obj.id]) | |
else |
# NOTE: this architecture hinges on the channels being specific to the user | |
# this allows us to know what permissions context to render templates under | |
# seeing as how this may need to be run in a background task without a "current user" context | |
# so the "current user" is really the recipient of the notification | |
class ApplicationPusher < ActionPusher::Base | |
attr_accessor :channel, :event, :current_user | |
include ActionController::HideActions | |
include Authorization::AuthorizationInController |
# | |
# = Capistrano Assets recipe | |
# | |
# Provides a couple of tasks for precompiling assets locally | |
# Assumes usage of AssetSync to deploy to CloudProvider or CDN | |
# | |
# Inspired by http://www.rostamizadeh.net/blog/2012/04/14/precompiling-assets-locally-for-capistrano-deployment | |
namespace :deploy do |