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
if (!Date.prototype.toISOString) { | |
Date.prototype.toISOString = function () { | |
function pad(n) { return n < 10 ? '0' + n : n; } | |
function ms(n) { return n < 10 ? '00'+ n : n < 100 ? '0' + n : n } | |
return this.getFullYear() + '-' + | |
pad(this.getMonth() + 1) + '-' + | |
pad(this.getDate()) + 'T' + | |
pad(this.getHours()) + ':' + | |
pad(this.getMinutes()) + ':' + | |
pad(this.getSeconds()) + '.' + |
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 'uri' | |
require 'socket' | |
if ARGV[0] and ( ARGV[0] == "-h" or ARGV[0] == "--help" ) | |
puts "#{$0} [-h|--help] [config]" | |
puts "Munin plugin to measure individual HTTP timings" | |
puts " --help,-h Show this help" | |
puts " config Prints the configuration for munin" |
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 'uri' | |
require 'pp' | |
uri = URI.parse "http://foo/bar?baz&frob#blamp" | |
pp uri.component.each_with_object({}).find_all { |c,h| h[c] = uri.send(c) } |
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 'find' | |
dirs_to_scan = [ '.' ] | |
dirs_to_scan = ARGV if ARGV.length > 0 | |
dirs_to_scan.each do |dir| | |
Find.find( dir ) do |entry| | |
if FileTest.directory?(entry) && FileTest.directory?(entry + "/.svn") | |
puts entry | |
Find.prune |
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 'find' | |
dir_to_scan = '.' | |
dir_to_scan = ARGV[0] if ARGV.count == 1 | |
dirs = [] | |
# First collect all directories, but ignore anything with .svn in it | |
Find.find( dir_to_scan ) do |entry| | |
next if entry =~ /\.svn/ |
NewerOlder