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/ruby | |
require 'rubygems' | |
gem 'RubyInline', '=3.6.3' | |
require 'scrubyt' | |
bus_data = Scrubyt::Extractor.define do | |
fetch 'http://rvm-online.de' | |
route = { :place_origin => "everswinkel", | |
:name_origin => "mitte", |
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/ruby | |
class A | |
def dsl &block | |
puts "dsl active" | |
instance_eval &block | |
end | |
private | |
def priv | |
puts "This is private - please stay out" | |
end |
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/ruby1.9 | |
def Hash.smash(keys, values) | |
h = {} | |
keyiterator,valueiterator = keys.each, values.each | |
loop { h[keyiterator.next] = valueiterator.next } | |
h | |
end | |
Hash.smash [1,2,3,4], [5,6,7,8] # => { 1=>5, 2=>6, 3=>7, 4=>8 } |
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
class Distance | |
FACTORS = { | |
:kilometers => 1000.0, | |
:meters => 1.0, | |
:decimeters => 0.1, | |
:centimeters => 0.01, | |
:millimeters => 0.001, | |
} | |
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
// add methods to existing | |
template<class T> | |
class TemplateProperty<T> { | |
public: | |
// convenience methods | |
EqualCondition& valueEqual(const T& value, const ConditionalAction& action = NoAction(), const ConditionalAction& elseaction = NoAction()) { | |
return dynamic_cast<EqualCondition&>(addCondition(EqualCondition<T>(0, this, value, action, elseaction))); | |
} | |
LessCondition& valueLess(const T& value, const ConditionalAction& action = NoAction(), const ConditionalAction& elseaction = NoAction()) { | |
return dynamic_cast<LessCondition&>(addCondition(LessCondition<T>(0, this, value, action, elseaction))); |
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
<calendar> | |
<calendarsection id="terminkalender" start="4/5/2008" end="5/6/2008"/> | |
<data id="geburtstage" type="iCal" src="geburtstage.ics"/> | |
<data id="termine" type="CSV" src="termine.csv" format="%s %s"/> | |
</calendarsection> | |
<calendarsection id="addressen" pagenumber="6"> | |
<data id="adressen" type="CSV" format="%s %s" src="blub.csv"/> | |
</calendarsection> | |
</calendar> |
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
// first beta command | |
CmdUtils.CreateCommand({ | |
name: "pbwiki", | |
//icon: "http://example.com/example.png", | |
//homepage: "http://example.com/", | |
author: { name: "Daniel Kirsch", email: "[email protected]"}, | |
license: "GPL", | |
description: "Searches in your pbwiki", | |
help: "Help! Dunno!", | |
takes: {"term": noun_arb_text}, |
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
class Foo | |
def foo | |
puts "parent" | |
end | |
end | |
class Foobar < Foo | |
def foo | |
puts "child" | |
super |
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
command line gist test |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://www.google.com/jsapi"></script> | |
</head> | |
<body> | |
<canvas id="tafel" width="400" height="400" style="border:solid 1px black;"> | |
Hier ist eine Tafel zum drauf malen... | |
</canvas> | |
<div id="info"></div> |
OlderNewer