Created
February 24, 2010 02:26
-
-
Save defunkt/313001 to your computer and use it in GitHub Desktop.
New Language Lexers
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
#main | |
:width 15em | |
:color #0000ff | |
p | |
:border | |
:style dotted | |
/* Nested comment | |
More nested stuff | |
:width 2px | |
.cool | |
:width 100px | |
#left | |
:font | |
:size 2em | |
:weight bold | |
:float left |
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
+ (id)boxEnclosingView:(CPView)aView | |
{ | |
var box = [[self alloc] initWithFrame:CGRectMakeZero()], | |
enclosingView = [aView superview]; | |
[box setFrameFromContentFrame:[aView frame]]; | |
[enclosingView replaceSubview:aView with:box]; | |
[box setContentView:aView]; | |
return box; | |
} |
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
%div[@article] | |
%h1= @article.title | |
%div= @article.body | |
#id[@article] id | |
.class[@article] class | |
#id.class[@article] id class | |
%div{:class => "article full"}[@article]= "boo" | |
%div{'class' => "article full"}[@article]= "moo" | |
%div.articleFull[@article]= "foo" | |
%span[@not_a_real_variable_and_will_be_nil] | |
Boo |
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
LotteryDraw: { | |
play: -> | |
result: LotteryTicket.new_random() | |
winners: {} | |
this.tickets.each (buyer, ticket_list) -> | |
ticket_list.each (ticket) -> | |
score: ticket.score(result) | |
return if score is 0 | |
winners[buyer] ||= [] | |
winners[buyer].push([ticket, score]) | |
this.tickets: {} | |
winners | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment