This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Session.prototype.initialize = function() { | |
this.bind("change:id", this.onIDChange, this); | |
if (localStorage.getItem("id" === !null || "")) { | |
return this.set({ | |
id: localStorage.getItem("id") | |
}); | |
} else { | |
console.log("ID not found: " + (this.toJSON())); | |
this.set({ | |
id: this.getNewID() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# write good code. | |
# namespace where it's smart to | |
@MYAPP = @MYAPP || {} | |
# use consistent patterns | |
# use the "do" keyword as much as you can. | |
@MYAPP.myModule = do ($) -> | |
# @ means this. | |
@myProp = myVal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21class CalculatorView extends Backbone.View | |
el: "[data-content=calculator]" | |
events: | |
"click [data-action=calculate]": "showResult" | |
initialize: -> | |
@model.bind "change:active", @render, @ | |
render: -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<td><%= name %></td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define ["backbone", "models/account"], (Backbone, Account) -> | |
class Account extends Backbone.Model | |
Account | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires that you're using the susy grid system (you should be anyway.) | |
=span-columns-and-fill-gutter($cols, $context: false) | |
@if ($context != false) | |
width: space($cols, $context) | |
@else | |
width: space($cols) | |
margin-right: 0 | |
padding-right: gutter() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define ["jquery"], ($)-> | |
class Toggle | |
constructor: (context, toggle, toggler, togglable, callback) -> | |
@context = context | |
@$context = $(@context) | |
@$toggle = $(@context).find(toggle) | |
@$toggler = $(@context).find(toggler) | |
@$togglable = $(@context).find(togglable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
define(["jquery"], function($) { | |
var Toggle; | |
Toggle = (function() { | |
function Toggle(context, toggle, toggler, togglable, callback) { | |
this.context = context; | |
this.$context = $(this.context); | |
this.$toggle = $(this.context).find(toggle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-webkit-keyframes slideIn { | |
from { | |
-webkit-transform: translateY(0); | |
-moz-transform: translateY(0); | |
-ms-transform: translateY(0); | |
-o-transform: translateY(0); | |
transform: translateY(0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" .vimrc File | |
" Maintained by: Vince Speelman | |
" [email protected] | |
" | |
"Forget compatibility with Vi. Who cares. | |
set nocompatible | |
filetype off |
OlderNewer