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
lastWeek = new Date('2014-05-07'); | |
db.git_queue.find({notified_build: {$ne: null}, finished_build: {$ne: null}}).forEach(function(el) { | |
if (new Date(el.notified_build) > lastWeek) { | |
total_ms = new Date(el.finished_build) - new Date(el.notified_build); | |
total_secs = total_ms / 1000; | |
total_mins = total_secs / 60; | |
print(total_mins); | |
} | |
}); |
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
total = count = max = 0; | |
min = 999; | |
lastWeek = new Date('2014-05-07'); | |
db.git_queue.find({status: {$ne: 'error'}, notified_build: {$ne: null}, finished_build: {$ne: null}}).forEach(function(el) { | |
if (new Date(el.notified_build) > lastWeek) { | |
total_ms = new Date(el.finished_build) - new Date(el.notified_build); | |
total_secs = total_ms / 1000; | |
total_mins = total_secs / 60; | |
count++; | |
total += total_mins; |
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
<?php | |
$options = array( | |
'conditions' => array( | |
'type' => 'json', | |
'accept' => array('application/json'), | |
), | |
); | |
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 Hubot | |
listen_for: {} | |
# @script_user | |
respond: (regex, callback) -> | |
@listen_for[regex] = callback | |
# @test_user | |
# @return bool Phrases matches one of the respond to callbacks. |
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
GRAPHITE_PORT=2003 | |
GRAPHITE_SERVER="127.0.0.1" | |
ERROR_PATH="project.codesniff.errors" | |
WARNING_PATH="project.codesniff.warnings" | |
APP_PATH="/var/www/apps/project/app" | |
APP_STANDARD="PEAR" | |
SETUP="cd ${APP_PATH} && git fetch origin > /dev/null 2>&1 && git reset --hard origin/dev > /dev/null 2>&1 && php composer.phar install > /dev/null 2>&1" | |
RESPONSE=`${SETUP} && ./bin/phpcs --standard=${APP_STANDARD} --report=summary ./ | grep TOTAL | awk -v ERROR_PATH=${ERROR_PATH} -v WARNING_PATH=${WARNING_PATH} '{ print ERROR_PATH,$4, strftime("%s") "\\\\n" WARNING_PATH, $7,strftime("%s") }'` |
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
<?php | |
class Repl { | |
public function run() { | |
while (true) { | |
echo '>> '; | |
echo eval($this->input()) . PHP_EOL; | |
} | |
} |
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
_.mixin | |
empty: (item) -> | |
item instanceof Array && item.length == 0 || '0' == item || !item |
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 'pry' | |
class SolrRequest | |
attr_accessor :params | |
def initialize(params = {}) | |
@params = params | |
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 'pry' # who doesn't want pry? | |
# Adds a `find` method to every model | |
module Finder | |
attr_accessor :types | |
def queries(*args) | |
@types = args | |
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 Line | |
constructor: (one, two) -> | |
@one = one | |
@two = two | |
m: -> | |
(@two.y - @one.y) / (@two.x - @one.x) | |
b: -> |