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
alias loc-files='git ls-files **/*.(rb|ru|coffee|scss|handlebars) script bin' | |
alias loc='loc-files | xargs cat | ruby -ne '\''print unless $_ =~ /^\s*#|^\s*$/'\'' | wc -l' |
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
boocx@ip-10-71-58-116:~/boocx-api$ APP_ENV=production bundle exec rake sidekiq:workers | |
bundle exec sidekiq -c 50 -l logs/sidekiq.log -q main -v -r ./lib/loader.rb -e production | |
2013-01-22 20:03:22 +0000: Reconnecting from timeout. | |
Network Error: eventmachine not initialized: evma_set_pending_connect_timeout | |
E, [2013-01-22T20:03:22.863555 #28988] ERROR -- : Sidekiq::Processor crashed! | |
AWS::DynamoDB::Errors::InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. | |
The Canonical String for this request should have been | |
'POST | |
/ |
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
pkill -f god | |
pkill -f sidekiq | |
sudo service boocx-app-web stop | |
sudo service boocx-api stop | |
cd /home/boocx | |
cd boocx-api | |
git pull | |
bundle | |
git submodule update --init |
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
count = 25 | |
name = "main" | |
starting = 0 | |
ending = starting + count | |
key = "queue:#{name}" | |
total_size = 0 | |
keep = {} | |
loop do |
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
->(klass){ names = klass.all.map(&:name); names.detect {|e| names.count(e) > 1 } }.call Tag | |
# Up arrow and change to Amenity, Usage, etc. ^ |
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
The original: | |
Father-Daughter Talk | |
A young woman was about to finish her first year of college. Like so many others her age, she considered herself to be a very liberal Democrat, and was very much in favor of the redistribution of wealth. She was deeply ashamed that her father was a rather staunch Republican, a feeling she openly expressed. Based on the lectures that she had participated in, and the occasional chat with a professor, she felt that her father had for years harbored an evil, selfish desire to keep what he thought should be his. | |
One day she was challenging her father on his opposition to higher taxes on the rich and the addition of more government welfare programs. The self-professed objectivity proclaimed by her professors had to be the truth and she indicated so to her father. He responded by asking how she was doing in school. Taken aback, she answered rather haughtily that she had a 4.0 GPA, and let him know that it was tough to maintain, insisting that she was taking a very difficult cours |
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
ssh-copy-id pi@192.168.X.X | |
# on the pi | |
sudo su - | |
cat <<EOF >> /etc/wpa_supplicant/wpa_supplicant.conf | |
network={ | |
ssid="Your SSID Here" | |
proto=RSN | |
key_mgmt=WPA-PSK | |
pairwise=CCMP |
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
run_list( | |
'recipe[chef-solo-search]', | |
'recipe[rails_application]' | |
) | |
default_attributes( | |
rails: { | |
app: {name: "sample_app"}, | |
deploy: { | |
repository: "https://github.com/jgarber/sample_app_2nd_ed.git" |
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
require 'json' | |
def replace_json(node, &replacement_action) | |
case node | |
when Hash | |
node.each_value do |item| | |
yield item | |
replace_json(item, &replacement_action) | |
end | |
when Array |
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
def make_one_dimensional(input = {}, output = {}, prefix = nil) | |
if input.respond_to?(:each) | |
input.each do |key, value| | |
key = [prefix, key].compact.join('.') | |
case value | |
when Hash | |
make_one_dimensional(value, output, key) | |
when Array | |
value.each_with_index do |v, index| | |
array_key = "#{key}[#{index}]" |