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
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
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
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
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
class BigDecimalWithoutTrailingZeroes < BigDecimal | |
def to_digits | |
_, significant_digits, _, exponent = split | |
if zero? | |
'0' | |
elsif exponent >= significant_digits.size | |
to_i.to_s | |
else | |
to_s('F') | |
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
class BigDecimalWithoutTrailingZeroes < BigDecimal | |
def to_digits | |
_, significant_digits, _, exponent = split | |
if zero? | |
'0' | |
elsif exponent >= significant_digits.size | |
to_i.to_s | |
else | |
to_s('F') | |
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
<?xml version="1.0"?> | |
<root> | |
<deviceproductdef> | |
<productname>APPLE_INTERNAL_KEYBOARD_TRACKPAD_0x024c</productname> | |
<productid>0x024c</productid> | |
</deviceproductdef> | |
<deviceproductdef> | |
<productname>APPLE_WIRELESS_KEYBOARD_0x22c</productname> | |
<productid>0x22c</productid> | |
</deviceproductdef> |
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
brew uninstall tmux | |
brew install https://raw.github.com/adamv/homebrew-alt/master/other/tmux-iterm2.rb | |
tmux -S /tmp/pair -C new -s session_name | |
chmod 777 /tmp/pair | |
tmux -S /tmp/pair -C attach -t session_name |
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
$ rails c | |
1.9.2p320 :007 > ActiveRecord::Base.connection.send :postgresql_version | |
=> 90102 | |
$ rake staging console | |
ActiveRecord::Base.connection.send :postgresql_version | |
=> 80311 | |
$ rake production console | |
ActiveRecord::Base.connection.send :postgresql_version |