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
PATH := node_modules/.bin:$(PATH) | |
SHELL := /bin/bash | |
browser_files := $(shell find src/browser -type f -name '*.js') | |
browser_specs := $(shell find test/browser -type f -name '*_spec.js') | |
browser_bundle := build/browser.js | |
karma_config := test/browser/karma.conf.js | |
browser_test := build/browser.spec.done | |
client_files := $(shell find src/client -type f -name '*.js') | |
client_specs := $(shell find test/client -type f -name '*_spec.js') |
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
#!/bin/bash | |
set -uf -o pipefail | |
ENVIRONMENT=$1 | |
SESSION_NAME=${2:-kay-${ENVIRONMENT}} | |
SERVER_SOCKET=/tmp/tmux-${SESSION_NAME} | |
SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
case ${ENVIRONMENT} in |
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
### Keybase proof | |
I hereby claim: | |
* I am pitluga on github. | |
* I am tonypitluga (https://keybase.io/tonypitluga) on keybase. | |
* I have a public key whose fingerprint is 3EB6 6263 A018 F003 36C3 66AB C75F 6C31 C878 A4E7 | |
To claim this, I am signing this object: |
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
EzCrypto::CipherWrapper.class_eval do | |
def initialize(key,target,mode,algorithm) | |
@cipher = OpenSSL::Cipher::Cipher.new(algorithm) | |
if mode | |
@cipher.encrypt | |
else | |
@cipher.decrypt | |
end | |
@cipher.key=key.raw |
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
(ns braintree-clj.core | |
(:import [com.braintreegateway BraintreeGateway Environment TransactionRequest Transaction$Type]) | |
(:require [clojure.string :as s] | |
[hiccup.core :as hiccup] | |
[hiccup.page-helpers :as page-helper] | |
[noir.core :as noir] | |
[noir.request :as noir-req] |
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 validate(params_hash) | |
errors = {} | |
errors[:model] = "is required" if params_hash[:model].nil? | |
errors[:pk] = "is required" if params_hash[:pk].nil? | |
errors | |
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
#!/bin/sh | |
passenger-status 10614 | grep global | |
echo | |
passenger-memory-stats 10614 | grep Rails | |
echo | |
/usr/local/bin/monit -c /srv/apps/ruby-app/current/config/monitrc -p /srv/apps/ruby-app/shared/pids/monit.pid -s /srv/apps/ruby-app/shared/system/monit.state status | awk '/Process/ { process=$2} /memory kilobytes tot/ { printf "%50s %7s\n", process, $4} ' | sed -e '$!N;s/\n//' |
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
BOTS = %w(Bully Dual Prospector Rage Random) | |
MAPS = 1..100 | |
def parse_results(output) | |
output = output.split("\n") | |
loss = (output[-1] =~ /Player 1 Wins/).nil? | |
turns = output[-2].split[1] | |
[!loss, turns.to_i] | |
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
BOTS = %w(Bully Dual Prospector Rage Random) | |
MAPS = 1..100 | |
def play_game(map, challenger) | |
cmd = %Q{java -jar tools/PlayGame.jar maps/map#{map}.txt 1000 1000 log.txt "ruby mybot.rb" "java -jar example_bots/#{challenger}Bot.jar"} | |
`#{cmd} 2> commentary.txt` | |
output = File.read('commentary.txt').split("\n") | |
victory = output[-1] =~ /Player 1 Wins/ |