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 'filewatcher' | |
| filenames = ["/Users/thomasf/ruby/roman_numerals_test.rb"] | |
| FileWatcher.new(filenames).watch(0.5) do |filename| | |
| print "\e[2J\e[f" | |
| puts "Reloading #{filename}" | |
| load(filename) | |
| MiniTest::Unit.new.run_tests | |
| end |
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 'minitest/autorun' | |
| class RomanNumerals | |
| def conv(str) | |
| 1 | |
| end | |
| end | |
| class RomanNumeralsTest < MiniTest::Unit::TestCase |
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 'minitest/autorun' | |
| class RomanNumerals | |
| def conv(str) | |
| 1 | |
| end | |
| end | |
| class RomanNumeralsTest < MiniTest::Unit::TestCase |
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 'filewatcher' | |
| # Autorun minitests when one of these files is updated: | |
| files = ["my_minitest_tests.rb","code_under_test.rb"] | |
| puts "Update one of these files to start tests: " + files.join(", ") | |
| FileWatcher.new(files).watch do |filename| | |
| puts "Updated " + filename | |
| load filename |
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/perl -w # camel code | |
| use strict; | |
| $_='ev | |
| al("seek\040D | |
| ATA,0, 0;");foreach(1..3) | |
| {<DATA>;}my @camel1hump;my$camel; | |
| my$Camel ;while( <DATA>){$_=sprintf("%-6 | |
| 9s",$_);my@dromedary 1=split(//);if(defined($ | |
| _=<DATA>)){@camel1hum p=split(//);}while(@dromeda |
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 'open-uri-and-write' | |
| file = open("https://www-dav.usit.uio.no/takk_for_meg.html","w") | |
| file.puts { "resourcetype" => "structured-article", | |
| "properties" => { "title" => "Takk for meg!", | |
| "introduction" => "Det har vært 10 fine år." | |
| "content" => "Hilsen Thomas Flemming", | |
| }.to_json | |
| file.proppatch('<v:publish-date xmlns:v="vrtx">' + Time.now.httpdate.to_s + '</v:publish-date>') |
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 'net/dav' | |
| require 'json' | |
| require 'highline/import' | |
| require 'osx_keychain' | |
| dav = Net::DAV.new('https://vortex-systest-dav.uio.no') | |
| keychain = OSXKeychain.new | |
| username = ENV['USER'] | |
| password = keychain['vortex-systest-dav.uio.no', username ] |
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 'net/dav' | |
| require 'json' | |
| require 'vortex_utils' | |
| dav = Net::DAV.new('https://vortex-systest-dav.uio.no/test/', :osx_keychain => true) | |
| article = { | |
| "resourcetype" => "structured-article", | |
| "properties" => { | |
| "title" => "Hello world!", |
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 'net/dav' | |
| require 'json' | |
| require 'highline/import' | |
| webdav_url = 'https://vortex-systest-dav.uio.no' | |
| dav = Net::DAV.new(webdav_url) | |
| username = ask("Username: ") | |
| password = ask("Password: ") {|q| q.echo = "*"} | |
| dav.credentials(username, 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
| <html> | |
| <head> | |
| <script language="javascript"> | |
| var regex = /uio_a_b_test=([^\;]+)/; | |
| var match = regex.exec(document.cookie); | |
| if(match === null){ | |
| var randomnumber = Math.floor(Math.random()*100); | |
| var days=14; | |
| var date = new Date(); | |
| date.setTime(date.getTime()+(days*24*60*60*1000)); |