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
aws s3 sync \ | |
s3://your-cloudtrail/AWSLogs/222222bbbbbb/CloudTrail/us-east-1/YYYY/MM/DD/ \ | |
~/s3/your-cloudtrail/AWSLogs/222222bbbbbb/CloudTrail/us-east-1/YYYY/MM/DD/ | |
ag -lz \ | |
c11db0a3-7309-4089-9750-3835fb522e9d \ | |
~/s3/your-cloudtrail/AWSLogs/222222bbbbbb/CloudTrail/us-east-1/YYYY/MM/DD/ | |
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
sudo find / -type f -printf '%k %p\n' | sort -h | tail |
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
desc "Run cucumber tests on each feature file in parallel, exits 0 if they all succeed and 1 otherwise" | |
task :test, :exclude do |task, args| | |
features_to_exclude = args.has_key?(:exclude) ? args[:exclude].split(' ') : [] | |
# actually task here | |
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
class Foo | |
attr_reader :number | |
def initialize | |
puts 'foo' | |
@number = 1 | |
end | |
end | |
describe Foo do |
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
arr = [{num: 1}, {num: 2}, {num: 3}] | |
arr.map{|h| h[:num] += 1; h} # [{:num=>2}, {:num=>3}, {:num=>4}] | |
arr # [{:num=>2}, {:num=>3}, {:num=>4}] | |
# is there a better way to do this? | |
arr = [{num: 1}, {num: 2}, {num: 3}] | |
arr.map{|h| clone = h.clone; clone[:num] += 1; clone} # [{:num=>2}, {:num=>3}, {:num=>4}] | |
arr # [{num: 1}, {num: 2}, {num: 3}] |
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
describe MyClass | |
let(:instance){MyClass.new} | |
describe '#myMethod' do | |
let(:input){ [1] } | |
context 'with input' do | |
it 'does stuff' do | |
instance.should_receive(:foo) | |
instance.should_receive(:bar) |