As configured in my dotfiles.
start new:
tmux
start new with session name:
| # note - you may need to split into a before-deploy (stop) and after-deploy (start) depending on your setup | |
| desc "Hot-reload God configuration for the Resque worker" | |
| deploy.task :reload_god_config do | |
| sudo "god stop resque" | |
| sudo "god load #{File.join deploy_to, 'current', 'config', 'resque.god'}" | |
| sudo "god start resque" | |
| end | |
| after 'deploy:update_code', 'deploy:update_shared_symlinks' |
| //祝日を求めるjavascript 昔書いたやつ | |
| // Ported From Calendar::Japanese::Holiday.pm | |
| "use strict" | |
| var FurikaeStr = '振替休日'; | |
| var staticHolidays = [ | |
| // 4/29 みどりの日 : 昭和の日 変更 | |
| // みどりの日は5/4に移行 | |
| { |
| from deployment.cuisine import * | |
| from fabric.api import * | |
| from fabric.context_managers import * | |
| from fabric.utils import puts | |
| from fabric.colors import red, green | |
| import simplejson | |
| import os |
| #This is the "site config" for nginx | |
| upstream django { | |
| # Distribute requests to servers based on client IP. This keeps load | |
| # balancing fair but consistent per-client. In this instance we're | |
| # only using one uWGSI worker anyway. | |
| ip_hash; | |
| server unix:/tmp/uwsgi.sock; | |
| } | |
| server { |
| /* vi:set ts=8 sts=4 sw=4: */ | |
| /* | |
| * strtod implementation. | |
| * author: Yasuhiro Matsumoto | |
| * license: public domain | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <math.h> |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| 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 |
| # Provides the ability to unscope associations, this solves problems described in | |
| # http://stackoverflow.com/questions/1540645/how-to-disable-default-scope-for-a-belongs-to/11012633#11012633 | |
| # | |
| # Examples | |
| # | |
| # class Document < ActiveRecord::Base | |
| # default_scope where(deleted: false) | |
| # end | |
| # | |
| # class Comment < ActiveRecord::Base |