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 ruby | |
# encoding: UTF-8 | |
# Umwandlung von Outlook exportiertes CSV (Win XP, Deutsch) in Apple Adressbook VCF | |
# Usage: | |
# csv2vcf adressen.csv > adressen.vcf | |
# requires Ruby 1.9 | |
require 'csv' |
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
# remove content of script tags using Sanitize | |
require 'sanitize' | |
html = '<p>Do not<script>fail();</script> kill the <a href="/cats/42">cat</a>.</p>' | |
Sanitize.clean(html, Sanitize::Config::BASIC.merge( | |
:transformers => lambda { |env| | |
node = env[:node] | |
return unless node.name.downcase == 'script' | |
node.children.each(&:remove) |
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
# encoding: UTF-8 | |
# Ein Zwölftonspielgenerator (nach Joseph Matthias Hauer) | |
# Language: German | |
# So läufts: | |
# Wenn Ruby 1.9: http://github.com/jvoorhis/midiator installieren, sonst | |
# sudo gem install midiator | |
# ruby zwölftonspiel.rb | |
# enjoy! |
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
From 935d1fe1a01f6b48f84cd1c6dbbe6bbd1318767a Mon Sep 17 00:00:00 2001 | |
From: Andreas Haller <[email protected]> | |
Date: Tue, 16 Mar 2010 00:04:36 +0100 | |
Subject: [PATCH] dont use Test::Unit::AssertionFailError (its gone in 1.9) | |
--- | |
koans/edgecase.rb | 2 +- | |
src/edgecase.rb | 2 +- | |
2 files changed, 2 insertions(+), 2 deletions(-) |
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
.bundle | |
db/*.sqlite3 | |
log/*.log | |
tmp/**/* |
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
From 086d026ea6f8da725e2f9cc254f0c069504e4510 Mon Sep 17 00:00:00 2001 | |
From: Andreas Haller <[email protected]> | |
Date: Thu, 1 Apr 2010 16:09:35 +0200 | |
Subject: [PATCH] show to_json issue | |
--- | |
spec/orm/activerecord_spec.rb | 6 ++++++ | |
1 files changed, 6 insertions(+), 0 deletions(-) | |
diff --git a/spec/orm/activerecord_spec.rb b/spec/orm/activerecord_spec.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
From 3786858be2d9ea56444fc0554a289a558d8bede9 Mon Sep 17 00:00:00 2001 | |
From: Andreas Haller <[email protected]> | |
Date: Fri, 8 Oct 2010 11:39:17 +0200 | |
Subject: [PATCH] `test_timer=on rake test` to print how long each test takes to run | |
--- | |
Rakefile | 7 +++++++ | |
lib/test_timer.rb | 40 ++++++++++++++++++++++++++++++++++++++++ | |
test/test_helper.rb | 7 +++++++ | |
3 files changed, 54 insertions(+), 0 deletions(-) |
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
/* small demo for handlebars.js, jQuery, require.js */ | |
/*global Handlebars */ | |
var cart = { | |
products: [ | |
], | |
total: function() { | |
var sum = 0; | |
for(var i in this.products) { | |
sum += this.products[i].price; |
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
# Example of how you can to use Capybara with plain Rails' integration tests and FactoryGirl (or plain MyModel.create…) | |
require 'test_helper' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'database_cleaner' | |
Capybara.app = Pardy::Application | |
Capybara.default_driver = :rack_test | |
DatabaseCleaner.strategy = :truncation |
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
.bundle | |
db/*.sqlite3 | |
log/*.log | |
tmp/**/* |