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:
| group :production do | |
| gem "unicorn" | |
| end |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| sudo apt-get update | |
| sudo apt-get install openjdk-6-jdk | |
| wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.deb | |
| sudo dpkg -i elasticsearch-0.19.8.deb | |
| # be sure you add "action.disable_delete_all_indices" : true to the config!! | |
| # if you want to remove it: | |
| sudo dpkg -r elasticsearch |
| def s3_form_tag(options = {}) | |
| bucket = options[:bucket] | |
| access_key_id = options[:access_key_id] | |
| secret_access_key = options[:secret_access_key] | |
| key = options[:key] || '' | |
| content_type = options[:content_type] || '' # Defaults to binary/octet-stream if blank | |
| redirect = options[:redirect] || '/' | |
| acl = options[:acl] || 'public-read' | |
| expiration_date = options[:expiration_date].strftime('%Y-%m-%dT%H:%M:%S.000Z') if options[:expiration_date] | |
| max_filesize = options[:max_filesize] || 671088640 # 5 gb |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| namespace :db do | |
| namespace :enable do | |
| desc "enable hstore extension" | |
| task :hstore => [:environment, :load_config] do | |
| ActiveRecord::Base.connection.execute('CREATE EXTENSION IF NOT EXISTS hstore;') | |
| end | |
| end | |
| Rake::Task['db:schema:load'].enhance ['db:enable:hstore'] | |
| end |
| # Run with: rake environment elasticsearch:reindex | |
| # Begins by creating the index using tire:import command. This will create the "official" index name, e.g. "person" each time. | |
| # Then we rename it to, e.g. "person20121001" and alias "person" to it. | |
| namespace :elasticsearch do | |
| desc "re-index elasticsearch" | |
| task :reindex => :environment do | |
| klasses = [Place, Person, Caption] |
| require 'celluloid' | |
| WORKERS_COUNT = (ARGV[0] || 1).to_i | |
| class Output | |
| include Celluloid | |
| def puts(msg) | |
| Kernel.puts(msg) | |
| end |
| # Description: | |
| # Submit time query to www.timeapi.org | |
| # | |
| # Commands: | |
| # hubot time - Current time in local timezone | |
| # hubot time <timezone> - Current time in timezone | |
| # hubot time <timezone> <query> - Time in timezone based on query | |
| module.exports = (robot) -> |