Skip to content

Instantly share code, notes, and snippets.

@catalogchoice
Created April 21, 2011 12:49
Show Gist options
  • Select an option

  • Save catalogchoice/934418 to your computer and use it in GitHub Desktop.

Select an option

Save catalogchoice/934418 to your computer and use it in GitHub Desktop.

Revisions

  1. catalogchoice created this gist Apr 21, 2011.
    5 changes: 5 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    namespace = (target, name, block) ->
    [target, name, block] = [(if typeof exports isnt 'undefined' then exports else window), arguments...] if arguments.length < 3
    top = target
    target = target[item] or= {} for item in name.split '.'
    block target, top