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
check process newrelic_resque_agent | |
matching "newrelic_resque_agent" | |
start program = "/usr/bin/ruby /usr/bin/newrelic_resque_agent run" | |
stop program = "/usr/bin/killall newrelic_resque_agent" | |
if cpu usage > 95% for 10 cycles then restart |
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
# Add to your .bash_profile | |
function dfwd { | |
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$1,tcp,127.0.0.1,$1,,$1" | |
} | |
function ddfwd { | |
VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "tcp-port$1" | |
} |
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
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
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
defaults write com.apple.finder AppleShowAllFiles -bool YES | |
killall Finder |
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
# on | |
sudo ipfw pipe 1 config bw 150KByte/s | |
sudo ipfw add 1 pipe 1 src-port 80 | |
# off | |
sudo ipfw delete 1 |
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
We have an open position at Kabam for a mid-level Backend Engineer. You would be working on my game team - The Hobbit: Armies of the Third Age! | |
Some reasons to consider in addition to the stock and competitive salary reasons: | |
* Work on a modern technology stack (Node.js, Rails 3.2+, MySQL, Redis) | |
* We're agile and practice TDD in order to move fast and NOT break things :), continuous integration, and solid build processes | |
* Interesting technical problems to solve involving low-level socket programming, server infrastructure scaling, AI programming, and software design, among other things | |
* Work on a game that has the IP from one of the largest fantasy franchises in history, The Hobbit!! And we've still got two more movies to go! | |
* Awesome team of talented, easy-to-work-with peers, very supportive management | |
* Healthy, profitable company who is a leader in Free to Play gaming across multiple platforms with plans for an IPO in the future |
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
tmux -- terminal multiplexer | |
Managing tmux sessions: | |
$ tmux # start tmux server | |
$ tmux at # attach running sessions to a terminal | |
$ tmux ls # list running tmux sessions | |
Sharing sessions between terminals: | |
$ tmux new -s session_name # make new named session | |
$ tmux at -t session_name # attach to exist session (allowing shared sessions) |
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
// change city | |
$(document).ready(function() { | |
// hides the slickbox as soon as the DOM is ready | |
// (a little sooner than page load) | |
var $altCity = $('#altCity'); | |
var $altCity2 = $('#altCity2'); | |
var $altCityHide = $('#altCityHide'); | |
var $altCityShow = $('#altCityShow'); |
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
search = Sunspot.new_search(Business) | |
search.build do |s| | |
s.keywords "#{query} electronics" | |
s.order_by :name if order == :alpha | |
s.order_by :review_count, :desc if order == :review_count | |
s.order_by :stars, :desc if order == :rating | |
s.paginate :page => page, :per_page => per_page | |
end | |
search.query.add_component(OpenStruct.new(:to_params => { :mm => 1 })) | |
search.execute! |
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
def nationwide_search | |
category_ids = self.category_ids | |
Business.search do |search| | |
search.any_of do | |
with :category_ids, category_ids unless category_ids.blank? | |
with :category_ids, nil | |
end | |
search.keywords query | |
search.order_by :name if order == :alpha | |
search.order_by :review_count, :desc if order == :review_count |