Skip to content

Instantly share code, notes, and snippets.

View NickJosevski's full-sized avatar

Nick Josevski NickJosevski

View GitHub Profile
@NickJosevski
NickJosevski / parseUri.coffee
Created August 23, 2012 06:16 — forked from mrclay/UFCOE.parseUri.js
Parse a URI using the browser's DOM (CoffeeScript)
class UriHelpers
parseUri: (url) ->
k = window.Common.UrlHelpers.UriParseModes
a || (a = window.document.createElement('a'))
#Let browser do the work
a.href = url
r = {}
r[k[i]] = a[k[i]] for i in [0..8]
@NickJosevski
NickJosevski / myview.js.coffee
Created March 8, 2012 00:36 — forked from tarnacious/myview.js.coffee
backbone example - serialize form + update on change
window.MyView = Backbone.View.extend({
initialize: ->
_.bindAll(this,'render')
this.template = window.JST["MyView"]
this.model.bind('change', this.render)
render: ->
$(this.el).html(this.template(this.model.toJSON()))
events: {