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
#!/usr/bin/env ruby | |
require 'net/http' | |
def build_is_fucked_on(server) | |
cruise_output = Net::HTTP.get(URI.parse("http://#{server}:3333/XmlStatusReport.aspx")) | |
return true if cruise_output.include? 'lastBuildStatus="Failure"' | |
return false | |
end | |
count = 0 | |
while true |
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 | |
path1=`echo $1 | awk -F, '{print $1}'`/$2 | |
path2=`echo $1 | awk -F, '{print $2}'`/$2 | |
if `curl -Ss $path1 | file - | grep text`; then | |
diff <(curl -Ss $path1) <(curl -Ss $path2) | |
else | |
diff <(curl -Ss $path1 | md5) <(curl -Ss $path2 | md5) | |
fi |
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
#!/usr/bin/env ruby | |
output = "" | |
ARGF.each do |line| | |
next if line.match(/^\+/) | |
if line.match(/\|\s+(\S+)/) | |
output << ($1 + ",") | |
end | |
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
(setq | |
elisp-path "~/.emacs.d/" | |
vendor-path "~/.emacs.d/vendor/") | |
;; Default Text Mode stuff | |
(setq inhibit-startup-message t) | |
(setq initial-scratch-message nil) | |
(setq make-backup-files nil) | |
(setq-default save-place t) |
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 'test_helper' | |
require 'minitest/autorun' | |
module Tenderlove | |
class Spec < MiniTest::Spec | |
include ActiveSupport::Testing::SetupAndTeardown | |
include ActiveRecord::TestFixtures | |
alias :method_name :__name__ if defined? :__name__ | |
self.fixture_path = File.join(Rails.root, 'test', 'fixtures') |
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
lines = File.open(path) | |
body = lines.map do |l| | |
if l.match /^::(.*)::(.*)$/ | |
instance_variable_set("@#{$1}", $2.strip ) | |
self.class.send(:attr_accessor, "#{$1}") | |
nil | |
else | |
l | |
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
autocmd BufRead,BufNewFile *_spec.rb | |
\ map ;t :w\|:!rspec --no-color %<cr> | |
autocmd BufRead,BufNewFile *_test.rb | |
\ map ;t :w\|:!ruby -Ilib %<cr> |
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
# started writing the tests for OrderedJobs class | |
# wrote no jobs and a single job, when I got to single job | |
# left that test failing because I realised I needed some | |
# kind of Job, and potentially a parser. | |
# | |
# Started working on a job class, tdd'd it to have a name | |
# and an optional dependancy, and nothing else. | |
# | |
# Still need a way of getting strings into Jobs to make my | |
# single job test case pass though, to keep the OrderedJobs |
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 'rack' | |
require 'jenkins-remote-api' | |
class OhGodBuildBot | |
def initialize | |
@jenkins = Ci::Jenkins.new('http://172.21.6.241:8080/') | |
end | |
def failing? | |
@jenkins.list_all_job_names.map{ |job| @jenkins.current_status_on_job(job) }.include? "failure" |
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 | |
#cat pokedex.html | grep '<tr>' -A 3 | grep 'title=' | cut -d' ' -f 7 | sed -e 's/.*\>\(.*\)<\/a>/\1/' | |
main(){ | |
echo `random_pokemon` | |
} | |
random_pokemon() { | |
index=`expr $RANDOM \% $(count) + 1` | |
pokedex | head -$index | tail -n 1 |
OlderNewer