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
check process unicorn | |
with pidfile "/var/run/unicorn/server.pid" | |
start program = "/etc/init.d/unicorn start" | |
stop program = "/etc/init.d/unicorn stop" | |
if failed unixsocket /var/run/unicorn/http.sock then restart |
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
check process mongodb | |
with pidfile "/var/lib/mongodb/mongod.lock" | |
start program = "/sbin/start mongodb" | |
stop program = "/sbin/stop mongodb" | |
if failed port 28017 protocol http | |
and request "/" with timeout 10 seconds then restart | |
if 5 restarts within 5 cycles then timeout |
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
trap 'INT' do | |
start_fresh "Done running tests." | |
exit! 0 | |
end | |
def run_spec(file) | |
return unless file.include?(" ") || File.exist?(file) | |
start_fresh "Running specs..." | |
system("time rspec --fail-fast -c #{file}") | |
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
require "java" | |
import java.util.concurrent.RecursiveAction | |
class Scorer < RecursiveAction | |
attr_reader :documents | |
def compute | |
if documents.size <= 10000 | |
score_each |
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
Failures: | |
1) Engine | |
Failure/Error: Unable to find matching line from backtrace | |
NoMethodError: | |
undefined method `invokeAll' for #<Scorer:0x2224a128> | |
# ./spec/../app/engine.rb:25:in `compute' |
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
dev@greedos-imac:~/Projects/yoda(master+*)$ bundle install | |
Updating git@github.com:mwarren/kirk.git | |
Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! | |
RuntimeError: can't modify frozen string | |
strip! at org/jruby/RubyString.java:5680 | |
initialize at /Users/dev/.rvm/rubies/jruby-1.6.5/lib/ruby/site_ruby/1.8/rubygems/version.rb:191 | |
create at /Users/dev/.rvm/rubies/jruby-1.6.5/lib/ruby/site_ruby/1.8/rubygems/version.rb:178 | |
version= at /Users/dev/.rvm/rubies/jruby-1.6.5/lib/ruby/site_ruby/1.8/rubygems/specification.rb:2092 | |
load_gemspec at /Users/dev/.rvm/gems/jruby-1.6.5@yoda/bundler/gems/kirk-44f41be56222/kirk.gemspec:9 | |
initialize at /Users/dev/.rvm/rubies/jruby-1.6.5/lib/ruby/site_ruby/1.8/rubygems/specification.rb:1346 |
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
@mode ➜ jruby rvm:(-ruby-1.9.2) git:(master) ✗ ant spec | |
Buildfile: /Users/durran/work/jruby/build.xml | |
init: | |
prepare-bin-jruby: | |
jar: | |
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
Profile Report | |
Thread ID Total Time | |
70123360768620 0.184724 | |
70123369188820 0.073909 | |
Thread 70123360768620 | |
%Total %Self Total Self Wait Child Calls Name Line | |
100.00% 0.06% 0.18 0.00 0.00 0.18 1 Phoenix::SessionsController#create 12 | |
0.11 0.00 0.00 0.11 1/1 Devise::Controllers::Helpers#user_signed_in? 16 | |
0.07 0.00 0.00 0.07 1/1 ActionController::Instrumentation#render 25 | |
0.00 0.00 0.00 0.00 2/5 ActiveSupport::BufferedLogger#debug 27 |
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
@mode ➜ jruby rvm:(system) git:(master) ✗ java -version | |
openjdk version "1.7.0-ea" | |
OpenJDK Runtime Environment (build 1.7.0-ea-b220) | |
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode) |
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
# Get the count of notifications for this user | |
# and this post that need to be sent or have *not* | |
# been sent in the past 24 hours | |
User. | |
where({ _id: user._id, "notifs.post_id" => post_id }). | |
any_of( | |
{ "notifs.needs_send" => true }, | |
{ "notifs.last_send" => { '$exists' => false }}, | |
{ "notifs.last_send" => { "$lt" => 1.days.ago.utc }} |