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
# run me with watchr watchr.rb in a ruby project | |
# don't run me in a rails project. :) | |
# run me with test unit. | |
# don't run me with rspec or cucumber, check out my other watchr gists | |
ENV["WATCHR"] = "1" | |
system 'clear' | |
def growl(message) | |
growlnotify = `which growlnotify`.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
# this is a watchr script for command line programs | |
# not rails. @squarism | |
ENV["WATCHR"] = "1" | |
system 'clear' | |
def growl(message) | |
growlnotify = `which growlnotify`.chomp | |
title = "Watchr Test Results" | |
passed = message.include?('0 failures') |
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 bash | |
# wtchr shell script - @squarism | |
# INSTALL | |
# gem install watchr | |
# cp wtchr ~/bin | |
# chmod u+x ~/bin/wtchr | |
# Run with: wtchr foo.rb |
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
# watchr script for running python 3 koans: | |
# https://github.com/gregmalcolm/python_koans | |
# put this in <python_koans_home>/python_koans_watchr.rb | |
# cd python_3 | |
# watchr ../python_koans_watchr.rb | |
ENV["WATCHR"] = "1" | |
system 'clear' |
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
begin | |
# load wirble | |
require 'rubygems' | |
require 'wirble' | |
# start wirble (with color) | |
Wirble.init | |
Wirble.colorize | |
# customize the colors a bit |
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
# sometimes watchr freaks out when you view this file in textmate (hits timestamp?) | |
# ie: it prints "Watching..." over and over | |
# just hit Ctrl-\ to run all tests and it calms down | |
ENV["WATCHR"] = "1" | |
puts "Watching..." | |
def growl(result) | |
result_lines = result.split("\n") | |
message = result_lines[result_lines.size - 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
# 38up 39right 40down 37left | |
def key_pressed | |
case key_code | |
when 32 | |
puts 'space' | |
when 37 | |
puts 'left' | |
when 38 | |
puts 'up' |
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
OS Setup | |
- Install VMs (base OS = Ubuntu 11.04) | |
- 6GB disk is not enough. Probably 20-40GB would be good. Mongo has a lot of compression and cleanup features coming. | |
- Create user to run MongoDB as | |
- Get DNS or Hosts file set up so all nodes in the cluster can talk to each other | |
- Generate ssh-keygen -t rsa | |
- Copy ssh public keys from each node to node01. Then cat all keys to authorized_keys. Then copy that file to each node. Each node will have ssh key trust now. You will also want to ssh from node01 to 02,03,04; from node02 to 01,03,04 etc to test it out. | |
- Create an initial architecture: | |
node01: master (replica set 1) | |
node02: slave (replica set 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
# I agree that Perl probably 'wins' because it just works. | |
# But consider how you'd make this work and what this means for less | |
# trivial "save typing" problems. | |
var = "1" | |
begin | |
if var > 0 | |
puts "yep" | |
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
# mirror rubygems somewhere with rubygems-mirror gem or git clone | |
# this is huge output, so try adding the ;1 at the end to suppress irb output | |
specs = Marshal.load open '/tmp/rubygems/specs.4.8'; 1 | |
# get a few gems to play with | |
few_gems = specs[0...10] | |
some.find_all {|gem| gem[0] =~ /24/} |
OlderNewer