This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WHO Reports: https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports | |
// Inspired by: https://twitter.com/paulg/status/1235247452145451013 | |
// Note: The growth rate does not seem sustainable. | |
// The projected OoC infections assumes a constant doubling of roughly every 4 days. | |
Date Projected-OoC-Infections WHO-Reported-OoC-Infections | |
2020-02-29 5,629 6,009 | |
2020-03-01 6,755 7,169 | |
2020-03-02 8,106 8,774 | |
2020-03-03 9,727 10,565 | |
2020-03-04 11,673 12,669 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) call (void) close(1) | |
(gdb) call (void) close(2) | |
(gdb) shell tty | |
/dev/ttys002 | |
(gdb) call (int) open("/dev/ttys002", 1, 0) | |
$1 = 1 | |
(gdb) call (int) open("/dev/ttys002", 2, 0) | |
$2 = 2 | |
(gdb) t a | |
Please specify a thread ID list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :jobs do | |
desc <<-EOD | |
Start delayed_job worker daemon. Requires passing start|stop|restart|reload|run|zap|status | |
to rake via `rake jobs:daemon[start]`. To pass arguments to Delayed::Command, call rake | |
like `rake jobs:daemon["--queue=something start"]` (Note the quotes wrapping the arguments!). | |
Available flags are: queues queue min_priority max_priority number_of_workers pid-dir | |
identifier monitor sleep-delay read-ahead prefix exit-on-complete | |
EOD | |
task :daemon, [:argv] => :environment do |t, args| | |
# If we have anything in args.extras we need to combined it with args[:argv] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iPad | |
1024 × 690 In landscape on iOS 4.3 | |
1024 × 672 In landscape on iOS 5 | |
768 × 946 In portrait on iOS 4.3 | |
768 × 928 In portrait on iOS 5 | |
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3 | |
1024 × 644 Always showing bookmarks bar in landscape on iOS 5 | |
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Wrapper around Rails' compute_public_path for generating fully-qualified URLs to assets | |
def compute_public_url( filename, dir, ext = filename.split('.').last ) | |
path = compute_public_path(filename, dir, ext) | |
"#{request.protocol}#{request.host_with_port}#{path}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=clearfix | |
* html & | |
:height 1px | |
* + html & | |
:display inline-block | |
&:after | |
:content "." | |
:display block | |
:height 0 | |
:clear both |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# description: A startup script to automatically start workers for delayed_job | |
APP_NAME = 'worker_startup_script' | |
APP_DIR = '<%= @node[:delayed_job][:app_path] %>' | |
DEFAULT_NUM_WORKERS = 4 | |
unless %w(start stop restart status).include? ARGV.first | |
puts "Usage: #{APP_NAME} start|stop|status|restart 4 (for 4 workers - start and restart only)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pool :apache_static_site do | |
cloud :web do | |
#keypair 'id_rsa' # Change this to the name of your keypair if it's not id_rsa | |
instances 1 | |
enable :haproxy # Also sets up Apache2 | |
has_file "/var/www/index.htm" do | |
content "<h1>Hello world!</h1>" | |
owner 'www-data' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The models | |
class User < ActiveRecord::Base | |
has_many :things | |
accepts_nested_attributes_for :things | |
end | |
class Thing < ActiveRecord::Base | |
belongs_to :user | |
validates_presence_of :user_id | |
validates_presence_of :name # For clarity below |