Skip to content

Instantly share code, notes, and snippets.

@taybenlor
Created May 8, 2012 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taybenlor/2632667 to your computer and use it in GitHub Desktop.
Save taybenlor/2632667 to your computer and use it in GitHub Desktop.
Most Useful CoffeeScript function
window.System =
delay: (num, fn) ->
if arguments.length == 1
setTimeout(num, 0)
else
setTimeout(fn, num)
# Use Like #
System.delay ->
doSomething() # executes something when next available
System.delay 400, ->
doSomething() # executes something in 400ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment