Skip to content

Instantly share code, notes, and snippets.

View csamuel's full-sized avatar

Chris Samuel csamuel

View GitHub Profile
// ==UserScript==
// @name Webmail Auto-Login
// @namespace https://webmail.bah.com
// @description Automatically login to webmail
// @include https://webmail.bah.com/
// @include https://webmail.bah.com/owa/auth/logon*
// @include https://webmail.bah.com/exchweb/bin/auth/owalogon*
// @include https://webmail.bah.com/CookieAuth.dll?GetLogon?*
// ==/UserScript==
// Notes:
// ==UserScript==
// @name OWA MailNotify
// @namespace http://blog.hacker.dk/category/greasemonkey/
// @description Keeps your Exchange OWA session alive and checks mail. Also while composing mail, etc.
// @include https://your-owa-server.tld/exchange/*?Cmd=navbar*
// ==/UserScript==
// Times in seconds
var refreshTime = 60;
var iframeLoadWaitTime = 3;
# Mimic Mac OS X Finder's sort by name.
class Array
def finder_sort
sort { |a, b| a.to_finder_sort <=> b.to_finder_sort }
end
end
class String
def to_finder_sort
result = self.dup
require 'java'
import javax.sound.midi.MidiSystem
import javax.swing.JFrame
import java.awt.event.KeyListener
# Prepare the synth, get channel 0
synth = MidiSystem.synthesizer
synth.open
channel = synth.channels[0]
# collect up our war into the deploy_from folder
# notice that all we're doing is a copy here,
# so it is pretty easy to swap this out for
# a wget command, which makes sense if you're
# using a continuous integration server like
# bamboo. (more on this later).
before 'deploy:update_code' do
unless(war.nil?)
puts "get war"
system("cp #{war} #{deploy_from}")
alias clover='mvn clean install clover2:instrument clover2:aggregate clover2:clover -Pdevelopment,development-resources,clover -Dmaven.clover.licenseLocation=./clover.license'
@csamuel
csamuel / ports.sh
Created April 22, 2010 16:49 — forked from defunkt/ports.sh
# List what ports are in use on OS X
sudo lsof -iTCP -sTCP:LISTEN -P
module SQLGrowler
class Subscriber < ActiveRecord::Railties::Subscriber
def sql(event)
super
g('%s (%.1fms) %s' % [event.payload[:name], event.duration, event.payload[:sql].squeeze(' ')])
end
end
def self.enable
if Kernel.respond_to?(:g)
def using(*args)
args.pop.each { |key, value| options[key.to_sym] = value } if Hash === args.last
args.each do |name|
if TestFramework.has?(name)
self.framework = name
elsif name == :integration
options[:integration] = true
else
Buildr.application.deprecated "Please replace with using(:#{name}=>true)"
options[name.to_sym] = true
def using(*args, &block)
case args.first
when Hash # Maven hash mapping
using :maven, *args
when Binding # Erb binding
using :erb, *args
when Symbol # Mapping from a method
raise ArgumentError, "Unknown mapping type: #{args.first}" unless respond_to?("#{args.first}_transform", true)
configure(*args, &block)
when Regexp # Mapping using a regular expression