Skip to content

Instantly share code, notes, and snippets.

View brianwisti's full-sized avatar

Brian Wisti brianwisti

View GitHub Profile
@brianwisti
brianwisti / default.coffee
Created June 11, 2012 14:46
Metro "Hello World" JavaScript, but in CoffeeScript
# Blank Metro Template, but in CoffeeScript
# Just a dumb rewrite of the default.js in
# http://msdn.microsoft.com/en-us/library/windows/apps/hh986964.aspx
buttonClickHandler = (eventInfo) ->
userName = document.getElementById("nameInput").value
greetingString = "Hello, #{userName}!"; # oh yeah, CS does string interpolation
document.getElementById("greetingOutput").innerText = greetingString
app = WinJS.Application
# No weirdness
.sub 'main' :main
.local string name
.local string greeting
.local pmc stdin
.local string prompt
prompt = "Please enter your name: "
print prompt
stdin = getstdin