THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
# RSpec matcher to spec delegations. | |
# Forked from https://gist.github.com/ssimeonov/5942729 with fixes | |
# for arity + custom prefix. | |
# | |
# Usage: | |
# | |
# describe Post do | |
# it { should delegate(:name).to(:author).with_prefix } # post.author_name | |
# it { should delegate(:name).to(:author).with_prefix(:any) } # post.any_name | |
# it { should delegate(:month).to(:created_at) } |
#!/bin/bash | |
# Copyright (c) 2010, 2013 Yu-Jie Lin | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
# of the Software, and to permit persons to whom the Software is furnished to do | |
# so, subject to the following conditions: | |
# |
On a clean Rails 4 install with Bundler 1.3.0, using --binstubs causes competition between Rails and Bundler for the contents of bin/rails (and bin/rake).
Just running bundle
will rewrite the Rails version of bin/rails to a version that doesn't work.
The fix is to use the new bundle binstubs <gemname>
command.
(see rails/rails#8974)
root_DN = /CN=Esotericsystems Root Authority/C=AT/ | |
issuing_DN = /CN=Esotericsystems Issuing Authority/C=AT/ | |
passphrase: | |
echo -n changeme > $@ | |
# | |
# Create param files, keys and Self-Signed Certificate for the Root CA | |
# | |
root-ca-dsa.param: passphrase |
max_connections = 1500 # (change requires restart) | |
shared_buffers = 12000MB # min 128kB, based on 80GB RAM DB | |
temp_buffers = 8MB # min 800kB | |
work_mem = 64MB # min 64kB | |
maintenance_work_mem = 1500MB # min 1MB | |
wal_level = hot_standby # minimal, archive, or hot_standby | |
checkpoint_segments = 256 # in logfile segments, min 1, 16MB each | |
checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0 | |
max_wal_senders = 6 # max number of walsender processes |
tmux list-pane -F '#S' | head -1 |
Jim Weirich:
This is how I explain it… Ruby has Procs and Lambdas. Procs are created with
Proc.new { }
, lambdas are created withlambda {}
and->() {}
.
In Ruby 1.8,
proc {}
creates lambda, and Ruby 1.9 it creates procs (don't ask).
Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.
This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.