New Languages Highlighted
CoffeeScript (.coffee) 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:…
CoffeeScript (.coffee)
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
}
Objective-J (.j)
+ (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;
}
Haml (.haml)
%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
Sass (.sass)
#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
Written by
Related posts
The top 10 gifts for the developer in your life
Whether you’re hunting for the perfect gift for your significant other, the colleague you drew in the office gift exchange, or maybe (just maybe) even for yourself, we’ve got you covered with our top 10 gifts that any developer would love.
Congratulations to the winners of the 2024 Gaady Awards
The Gaady Awards are like the Emmy Awards for the field of digital accessibility. And, just like the Emmys, the Gaadys are a reason to celebrate! On November 21, GitHub was honored to roll out the red carpet for the accessibility community at our San Francisco headquarters.
Students: Start building your skills with the GitHub Foundations certification
The GitHub Foundations Certification exam fee is now waived for all students verified through GitHub Education.