24
Band of Brothers
Breaking Bad
Dexter
Golaith
Friends
HIMYM
This file contains hidden or 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
git clone <git-url> <dest-dir> | |
cd <dest-dir> | |
git checkout tags/$(git tag -l | tail -1) |
This file contains hidden or 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
# NullStorage provider for CarrierWave for use in tests. Doesn't actually | |
# upload or store files but allows test to pass as if files were stored and | |
# the use of fixtures. | |
class NullStorage | |
attr_reader :uploader | |
def initialize(uploader) | |
@uploader = uploader | |
end |
This file contains hidden or 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
#################################################### | |
# WARNING: Don't use this on production environments | |
#################################################### | |
# Login to psql terminal with postgres user | |
psql -U postgres | |
DROP ROLE root; # Run this if role root already exists | |
CREATE ROLE root WITH SUPERUSER LOGIN PASSWORD NULL; | |
createdb root; |
This file contains hidden or 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
$ vagrant up | |
Bringing machine 'management' up with 'virtualbox' provider... | |
Bringing machine 'lb' up with 'virtualbox' provider... | |
Bringing machine 'web1' up with 'virtualbox' provider... | |
Bringing machine 'web2' up with 'virtualbox' provider... | |
==> management: Importing base box 'ubuntu/trusty64'... | |
==> management: Matching MAC address for NAT networking... | |
==> management: Checking if box 'ubuntu/trusty64' is up to date... | |
==> management: A newer version of the box 'ubuntu/trusty64' is available! You currently | |
==> management: have version '20150521.0.0'. The latest is version '20150609.0.10'. Run |
This file contains hidden or 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
[ | |
{"apples": 53245, "oranges": 200}, | |
{"apples": 28479, "oranges": 200}, | |
{"apples": 19697, "oranges": 200}, | |
{"apples": 24037, "oranges": 200}, | |
{"apples": 40245, "oranges": 200} | |
] |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
This file contains hidden or 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 bash | |
APP_DIR=<%= current_path %> | |
CURRENT_DIR="cd $APP_DIR" | |
STAGE=<%= fetch(:stage) %> | |
DJ_PID="$APP_DIR/tmp/pids/delayed_job.pid" | |
check_pid(){ | |
if [ -f $DJ_PID ]; then | |
PID=`cat $DJ_PID` |
This file contains hidden or 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
[Unit] | |
Description=Delayed Job - Database based asynchronous priority queue system | |
[Service] | |
Type=forking | |
PIDFile=/home/<%= fetch(:user) %>/<%= fetch(:application) %>/current/tmp/pids/delayed_job.pid | |
ExecStartPre=/bin/rm -f /home/<%= fetch(:user) %>/<%= fetch(:application) %>/current/tmp/pids/delayed_job.pid | |
ExecStart=/etc/init.d/delayed_job start | |
Restart=always |
This file contains hidden or 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
# place in lib/tasks/ | |
namespace :sidekiq do | |
desc "Strano | Stop sidekiq" | |
task :stop do | |
system "bundle exec sidekiqctl stop #{pidfile}" | |
end | |
desc "Strano | Start sidekiq" | |
task :start do |