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 'rubygems' | |
| require 'rack/cache' | |
| infinity = Proc.new do |env| | |
| # env['HTTP_CACHE_CONTROL'] = 'max-age=60' | |
| [200, {"Content-Type" => "text/plain", 'Cache-Control' => 'max-age=60'}, env.inspect] | |
| end | |
| use Rack::CommonLogger |
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 'active_support/core_ext/string' | |
| module CleanURIs#:nodoc: | |
| # Having these methods as module methods instead of in just a simple mixin | |
| # enables stubbing them more easily (which is important when File system | |
| # access is stubbed in tests (as it should) because the unicode-support uses | |
| # filesystem access to generate some lookup tables and will fail. So it needs | |
| # to be stubbed out aswell | |
| module UTF8Helper#:nodoc: |
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 'rubygems' | |
| require 'nokogiri' | |
| require 'mechanize' | |
| require 'logger' | |
| module BankBalance | |
| class NabFetcher | |
| def fetch(client_number, password) |
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/ruby | |
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'uuidtools' | |
| require 'date' | |
| require 'activesupport' # For DateTime.to_time | |
| require 'uri' |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title></title> | |
| <link rel="stylesheet" href="style.css" type="text/css" /> | |
| <script src="script.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| </body> |
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
| #!/bin/bash | |
| ############################################################################ | |
| # Script to open a directory in TextMate excluding certain directories that | |
| # tend to slow down the Find in Project... function. | |
| # | |
| # Place in an executable loctation with a name of your choosing. | |
| # I use `ate' and have it in ~/Local/bin (which has been added to $PATH) | |
| ############################################################################ |
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 'rubygems' | |
| require 'hpricot' | |
| require 'time' | |
| if ARGV.size < 1 | |
| puts "Usage: fix_times.rb file.gpx" | |
| exit 2 | |
| end | |
| File.open(ARGV[0]) do |f| |
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
| module Spec | |
| module Mocks | |
| # module ArgumentMatchers # rspec > 1.1.12 | |
| module ArgumentConstraints | |
| # Based on: | |
| # http://trottercashion.com/2009/2/12/custom-argumentmatchers-in-rspec | |
| class NumericNearMatcher | |
| def initialize(expected, tolerance) |
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 'rubygems' | |
| require 'aws/s3' | |
| proxy = { | |
| :host =>'host', | |
| :port => 3128, | |
| :user =>'user', | |
| :password =>'pass', | |
| } | |
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
| " Find delimiters in content | |
| /^-\{5,8\}[\n\r]\+[^:-]*$ | |
| " Find unwanted control characters | |
| /[^A-^H^K^L^N-^_] |