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
#!/usr/bin/env ruby | |
# Kill crazy BTServer processes when the iPad simulator is running and | |
# you wake your Mac from sleeping | |
seconds_between_checking = 30 | |
kill_threshold_percent = 10.0 | |
while true do | |
ps_out_full = %x[ps aux | grep BTServer] |
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
showsdks = %x[xcodebuild -showsdks | grep sdk | grep iphonesimulator] | |
results = [] | |
showsdks.each_line do |sdkline| | |
sdk = /-sdk (\S+)/.match(sdkline)[1] | |
return_code = system("export IOS_SDK=#{sdk}; rake test") | |
results << "#{sdk} success?#{return_code}" | |
end | |
results.each do |r| | |
puts r | |
end |
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
require 'frank-cucumber' | |
temp_app_path= `find . -regex ".*[Ff]rankified\.app$"`.chomp | |
if temp_app_path.empty? | |
temp_app_path= `find ../build -regex ".*[Ff]rankified\.app$"`.chomp | |
end | |
if temp_app_path.empty? | |
temp_app_path= `find ~/Library/Developer/Xcode/DerivedData -regex ".*[Ff]rankified\.app$"`.chomp |
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
Around('@no_connection_to_qaserver') do |scenario, block| | |
%x[sudo ipfw add 10 deny tcp from qaserver to me] | |
%x[sudo ipfw add 11 deny tcp from me to qaserver] | |
block.call | |
%x[sudo ipfw delete 11 > /dev/null 2>&1] | |
%x[sudo ipfw delete 10 > /dev/null 2>&1] | |
end | |
Around('@no_network') do |scenario, block| | |
%x[sudo ifconfig en1 down] |
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
class CalculatorFormController < Formotion::FormController | |
attr_accessor :calc | |
def done | |
puts "row done #{@form.render}" | |
@calc.got_answers @form.render | |
new_form = Formotion::Form.new(@calc.get_questions) | |
@form = new_form | |
@form.controller = self |
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
#! /usr/bin/env ruby | |
workspace_name = %x[ls].split.find{ |file_name| file_name.include? 'xcworkspace' } | |
project_name = workspace_name.split('.')[0] | |
pwd = %x[pwd].strip | |
settings = %x[xcodebuild -workspace #{workspace_name} -showBuildSettings -scheme #{project_name}] | |
%x[xcodebuild -workspace #{workspace_name} test -scheme #{project_name} -destination OS=6.1,name=iPad -configuration Debug] | |
if $? == 0 | |
full_build_root = settings[/BUILD_ROOT = (.*)/].split[2] | |
full_build_root[/(.*)\/Build\/Products/] | |
root_for_gcovr = $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
;; cell | |
[1 2] | |
;; world | |
#{ [1 0] [1 1] [1 2]} | |
;; compute neighbors of a cell | |
(defn neighbors [[x y]] | |
(for [dx [-1 0 1] | |
dy (if (zero? dx) |
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
(and (odd? 5) (odd? 7)) | |
(or (odd? 4) (odd? 7)) | |
(def *is-it-even* (atom nil)) | |
(or (odd? 4) (reset! *is-it-even* true)) | |
@*is-it-even* |
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
(ns wizard) | |
(def nodes {:living-room "You are in the living room. A wizard is snoring loudly on the couch. " | |
:garden "You are in a beautiful garden. There is a well in front of you. " | |
:attic "You are in the attic. There is a giant welding torch in the corner. "}) | |
;(nodes :living-room) | |
(defn describe-location [loc node-list] | |
(loc node-list)) |
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
(defn say-hello [] | |
(println "Please type your name:") | |
(let [name (read)] | |
(println "Nice to meet you, " name))) | |
(def hello "123") | |
(println "blah blah") | |
OlderNewer