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
function controlStuff(){ | |
var listOfThings = loadThings() | |
for(thing in listOfThings.whereTypeIs(CanDoSomething)){ | |
thing.doSomething() | |
} | |
} | |
// or just... | |
function controlStuff(){ |
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
classpath "tagsoup-1.2.1.jar,src" | |
uses gw.xml.simple.SimpleXmlNode | |
uses org.ccil.cowan.tagsoup.* | |
uses java.io.* | |
uses org.xml.sax.* | |
var src = "<html><body><table class='right halves'><tr></tr><tr></tr><tr><td>1</td><td>2</td><td>3</td></tr></table></body></html>" | |
var r = new Parser() |
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
package hacks | |
uses gw.xml.simple.SimpleXmlNode | |
enhancement SimpleXmlNodeEnhancement : SimpleXmlNode { | |
function children( str : String ) : List<SimpleXmlNode> { | |
return this.Children.where( \ s -> s.Name == str ) | |
} | |
} |
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
print( "hello world" ) | |
for( str in { "I", "love", "gosu" } ) { | |
print( str ) | |
} |
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
<%= form_for @article, :url => { :action => "create" }, :html => {:class => "nifty_form"} do |f| %> | |
<%= f.text_field :title %> | |
<%= f.text_area :body, :size => "60x12" %> | |
<%= f.submit "Create" %> | |
<% end %> | |
... | |
${formTag(ArticleController.create(article), :html = {"class" -> "nifty_form"} )} | |
${textField(article#Title)} |
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
print( "Hello World" ) |
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
print( "You never thought we'd release, did you? ;p" ) |
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
<% var post = ... %> | |
${formFor(PostController#update(post))} | |
${input(post#Content)}<br/> | |
${submit("Update Post")} | |
${endForm} |
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
## Something like this would poll the given url every 500ms and merge any new HTML into the div | |
## with a nice, clean, pluggable transition | |
<div data-model-endpoint="https://myserver/my-div-endpoint" data-model-update="poll 500ms"> | |
... | |
</div> | |
## Something like this would poll the given url every 500ms and merge/delete the rows in a visually | |
## appealing manner like this fantastic plugin: | |
## http://www.scottlogic.com/blog/2011/01/04/animating-html-ranking-tables-with-javascript.html |
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
test |
OlderNewer