Skip to content

Instantly share code, notes, and snippets.

View VinSpee's full-sized avatar
🏠
Working from home

Vince Speelman VinSpee

🏠
Working from home
View GitHub Profile
@VinSpee
VinSpee / app.js
Created January 14, 2013 23:30
newbing hard on passing the return value of functions
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()
@VinSpee
VinSpee / example.coffee
Created January 15, 2013 15:35
Using CoffeeScript with our build system
# 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
21class CalculatorView extends Backbone.View
el: "[data-content=calculator]"
events:
"click [data-action=calculate]": "showResult"
initialize: ->
@model.bind "change:active", @render, @
render: ->
@VinSpee
VinSpee / angry-cat.html
Last active December 11, 2015 09:58
Marionette Fail... Any Idea why this marionette app isn't rendering "name"? The collection is loaded.
<td><%= name %></td>
@VinSpee
VinSpee / account.coffee
Last active December 11, 2015 10:28
how can I override Backbone.parse to parse this?
define ["backbone", "models/account"], (Backbone, Account) ->
class Account extends Backbone.Model
Account
@VinSpee
VinSpee / fill-gutter.sass
Last active December 11, 2015 16:09
fill a gutter with padding from your el instead of margin.
// 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()
@VinSpee
VinSpee / toggle.coffee
Last active December 11, 2015 17:48
coffee class fail: This should be a simple reusable toggler. it's defined in toggle.coffee and initiated in ui.coffee. The problem is this: @doToggle is begin called immediately upon init, it's not waiting for a click. any Ideas?
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)
(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);
@VinSpee
VinSpee / slidein.css
Created January 27, 2013 19:41
css3 animations
@-webkit-keyframes slideIn {
from {
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
" .vimrc File
" Maintained by: Vince Speelman
" v@vinspee.me
"
"Forget compatibility with Vi. Who cares.
set nocompatible
filetype off