Skip to content

Instantly share code, notes, and snippets.

@pope
pope / gist:4902
Created August 11, 2008 17:37 — forked from anonymous/gist:4900
require 'autotest/redgreen'
module Autotest::Growl
def self.growl title, msg, img, pri=0, stick=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{ msg.inspect} #{title} #{stick}"
end
Autotest.add_hook :ran_command do |autotest|
results = [autotest.results].flatten.join("\n")
output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+pending)?/)
#taken and modified from http://github.com/dkubb/dm-dev/tree/master
desc 'Strip trailing whitespace from source files'
task :strip do
require 'pathname'
require 'zlib'
# files and extensions to process
files = %w[ capfile CHANGELOG MIT-LICENSE README README_FOR_APP RUNNING_UNIT_TESTS Rakefile TODO USAGE .autotest .gitignore ].freeze
extensions = %w[ builder cgi conf css deploy erb example fcgi haml htc htm html js java key opts php properties rake ratom rb rcsv rdf rhtml rjs rpdf rxml sake sass sh sql txt vcf xml yml ].freeze
require 'rubygems'
require 'twitter'
require 'ruby-growl'
require 'simple-daemon'
require 'tempfile'
require 'net/http'
class Growitter < SimpleDaemon::Base
SimpleDaemon::WORKING_DIRECTORY = "/Users/dir/Desktop"
function Set() {
this.data = {};
this.length = 0;
for (var i = 0; i !== arguments.length; i++) {
this.add(arguments[i]);
}
}
(function(proto) {
function eachProp(obj, fn) {
@pope
pope / Component.java
Created October 23, 2008 17:51
JRuby Bug
class Component {
private Integer id;
public Integer getID() { return id; }
public void setID(id) { this.id = id; }
}
@pope
pope / fbr.rb
Created November 15, 2008 15:01 — forked from tmm1/fbr.rb
# Poor Man's Fiber (API compatible Thread based Fiber implementation for Ruby 1.8)
# (c) 2008 Aman Gupta (tmm1)
unless defined? Fiber
require 'thread'
class FiberError < StandardError; end
class Fiber
def initialize
*-network:0
description: Ethernet interface
product: 79c970 [PCnet32 LANCE]
vendor: Advanced Micro Devices [AMD]
physical id: 3
bus info: pci@0000:00:03.0
logical name: eth0
version: 40
serial: 08:00:27:c3:b9:89
size: 10MB/s
eth0 Link encap:Ethernet HWaddr 08:00:27:c3:b9:89
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1698 (1.6 KB) TX bytes:3428 (3.4 KB)
Interrupt:11 Base address:0xc020
eth1 Link encap:Ethernet HWaddr 08:00:27:c3:62:0c
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0 Link encap:Ethernet HWaddr 08:00:27:c3:b9:89
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9690 (9.6 KB) TX bytes:3078 (3.0 KB)
Interrupt:11 Base address:0xc020
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
o--o starting_branch_one
o--o--o--o starting_branch_two
what I want:
o--o starting_branch
\
o--o--o--o starting_branch_two