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 | |
def foo(a, b, c = 1, d = 2) | |
puts "a: #{a.inspect}" | |
puts "b: #{b.inspect}" | |
puts "c: #{c.inspect}" | |
puts "d: #{d.inspect}" | |
end | |
puts "Example 1: Two Arguments Passed" |
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
0.03s$ sudo service redis-server start | |
redis-server start/running, process 1810 | |
0.07s$ sudo service elasticsearch start | |
* Starting Elasticsearch Server it: error setting limit (Operation not permitted) | |
error: permission denied on key 'vm.max_map_count' | |
postgresql | |
Starting PostgreSQL v9.3 | |
2.17s$ sudo service postgresql stop | |
* Stopping PostgreSQL 9.4 database server 2.46s$ sudo service postgresql start 9.3 | |
This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables. |
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 --disable-gems | |
# Installation Instructions: | |
# Create a file ~/bin/iternum with this content in it and chmod u+x | |
# ~/bin/iternum. Then make sure that ~/bin is in your PATH environment | |
# variable and you should be good to go. | |
WEEKS_IN_ITERATION=2 | |
def week_number |
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
echo "woot" | |
trap "echo 'got SIGHUP'; exit 255" SIGHUP | |
trap "echo 'got SIGABRT'; exit 255" SIGABRT | |
trap "echo 'got SIGSEGV'; exit 255" SIGSEGV | |
trap "echo 'got SIGURG'; exit 255" SIGURG | |
trap "echo 'got SIGTTIN'; exit 255" SIGTTIN | |
trap "echo 'got SIGVTALRM'; exit 255" SIGVTALRM | |
trap "echo 'got SIGUSR2'; exit 255" SIGUSR2 | |
trap "echo 'got SIGINT'; exit 255" SIGINT |
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
%s/\([a-zA-Z0-9:_@\.]\+\)\.stub\>/allow(\1).to receive/gc | |
%s/\([a-zA-Z0-9:_@\.]\+\)\.should_receive\>/expect(\1).to receive/gc | |
%s/\([a-zA-Z0-9:_@\.]\+\)\.should_not_receive\>/expect(\1).not_to receive/gc | |
%s/\([a-zA-Z0-9:_@\.\?\[\]"'()\/~]\+\)\.should\s*==\s*\(.*\)$/expect(\1).to eq(\2)/gc | |
%s/\([a-zA-Z0-9:_@\.\?\[\]"'()\/~]\+\)\.should_not\s*==\s*\(.*\)$/expect(\1).not_to eq(\2)/gc | |
%s/\([a-zA-Z0-9:_@\.\?\[\]"'()\/~]\+\)\.should\s\+\(.*\)$/expect(\1).to \2/gc | |
%s/\([a-zA-Z0-9:_@\.\?\[\]"'()\/~]\+\)\.should_not\s\+\(.*\)$/expect(\1).not_to \2/gc | |
%s/stub\>/double/g | |
%s/mock\>/double/g |
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
☺ spring rspec spec ruby-1.9.3-p327@capture_api 5769m create_capture_rlevents_CAP-1006 5cb6510 | |
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.0 | |
/Users/adeponte/code/reachlocal/capture_api/spec/lib/internal_reporting/events_detail_report_form_spec.rb:4:in `<top (required)>': uninitialized constant InternalReporting::Event | |
sDetailReportForm (NameError) | |
from /Users/adeponte/.rvm/gems/ruby-1.9.3-p327@capture_api/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `block in load_spec_files' | |
from /Users/adeponte/.rvm/gems/ruby-1.9.3-p327@capture_api/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each' | |
from /Users/adeponte/.rvm/gems/ruby-1.9.3-p327@capture_api/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files' | |
from /Users/adeponte/.rvm/gems/ruby-1.9.3-p327@capture_api/gems/rspec-core-2.12.2/lib/rspec/core/co |
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
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" | |
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] | |
then | |
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" | |
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] && | |
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true | |
if [[ $- == *i* ]] # check for interactive shells | |
then echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green | |
else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells | |
fi |
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
☹ VAGRANT_LOG=INFO vagrant up | |
INFO global: Vagrant version: 1.0.6 | |
INFO vagrant: `vagrant` invoked: ["up"] | |
INFO environment: Environment initialized (#<Vagrant::Environment:0x00000100994890>) | |
INFO environment: - cwd: /Users/adeponte/Desktop/vagrant_tutorials/vagrant_guide | |
INFO environment: Home path: /Users/adeponte/.vagrant.d | |
INFO plugin: Searching and loading any available plugins... | |
INFO plugin: Loaded 0 plugins. | |
INFO environment: Loading configuration... | |
INFO cli: CLI: [] "up" [] |
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
class DrewTest | |
def initialize | |
@name = self.class.build_name | |
end | |
def self.build_name | |
return "bar" | |
end | |
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
☺ rvm help mount ruby-1.9.3-p327@capture_api 32m add_cassandra_migrations 9a8dd8d | |
Usage: | |
rvm automount | |
rvm mount /path/to/ruby [-n {name}] | |
rvm mount [-r] {https://url/to/ruby.tar.bz2} [name] | |
## Mounting local compiled rubies |