Skip to content

Instantly share code, notes, and snippets.

View code-for-coffee's full-sized avatar

James code-for-coffee

  • Chicago, IL
View GitHub Profile
@code-for-coffee
code-for-coffee / karma_install.bat
Created April 23, 2014 18:55
Karma installation on windows
npm install -g karma
npm install -g karma-cli
@code-for-coffee
code-for-coffee / gist:3adf9f6ef3d9b1df37df
Last active August 29, 2015 14:04
Border-radius sample for Chris
<html lang="en">
<head>
<!-- in Stylesheets, a class can be prefixed with a "." and an ID with a "#" -->
<style type="text/css">
/* assign the entire HTML body an ID of "home" */
#home {
font-weight: bold;
font-color: black;
}
/* you only need to worry about this "class" */
@code-for-coffee
code-for-coffee / gist:44c8b6f756a56cc3e1bf
Created July 27, 2014 03:20
brief-intro-to-modern-html-and-css
/**
* A brief intro to Modern HTML and CSS
*/
<table></table>'s have been replaced by <div></div>'s for body layout. This allows for more flexibility in modern browser
rendering engines (and uses less memory to compute positioning). Tables are now used for data output
(such as charts, grids, raw data, etc).
To style these divs and give them a meaning, there are a variety of HTML styles that can be applied.
These are traditionally stored in an external stylesheet inside of the <head></head> HTML tags, ie:
@code-for-coffee
code-for-coffee / ch2-1.js
Last active August 29, 2015 14:12
Backbone Enterprise Book Ch2.1
/* Create namespace objects for each Backbone object type */
App = new Object() || {};
App.Models = new Object() || {};
App.Views = new Object() || {};
App.Routers = new Object() || {};
App.Collections = new Object() || {};
@code-for-coffee
code-for-coffee / ch2-2.js
Last active August 29, 2015 14:12
Backbone Enterprise Book Ch2.2
/* use namespace for storage */
App.Models.BaseModel = Backbone.Model.extend({
defaults: {
id: 1,
name: "BaseModel"
}
});
App.Views.BaseView = Backbone.View.extend({
el: undefined,
model: undefined
@code-for-coffee
code-for-coffee / ch2-3.js
Created December 25, 2014 22:05
Backbone Enterprise Book - Ch2.3
/* use namespace for storage */
var myModel = new App.Models.BaseModel({
comment: "Test!"
});
var myView = new App.Views.BaseView({
el: $('body'),
model: myModel
});
@code-for-coffee
code-for-coffee / ch2-4.js
Created December 25, 2014 22:08
Backbone Enterprise Book - Ch2.4
/* Create namespace objects for each Backbone object type */
App = new Object() || {};
App.Models = new Object() || {};
App.Views = new Object() || {};
App.Routers = new Object() || {};
App.Collections = new Object() || {};
App.ActiveModels = new Object() || {};
App.ActiveViews = new Object() || {};
App.ActiveRouters = new Object() || {};
App.ActiveCollections = new Object() || {};
@code-for-coffee
code-for-coffee / ch3-1.js
Last active August 29, 2015 14:14
Backbone Enterprise Practices Ch3 #1
App = new Object() || {};
App.Models = new Object() || {};
App.Collections = new Object() || {};
App.Views = new Object() || {};
App.Models.TableRow = Backbone.Model.extend({
});
@code-for-coffee
code-for-coffee / ch3-table-view.hbs
Created February 4, 2015 05:51
Backbone Best Practices - Ch3 Table View
{{!-- view-table-template --}}
<div class="table-responsive">
<table class="table">
<thead>
{{#each column}}
{{this}}
{{/each}}
</thead>
<tbody id="{{tbody-id}}" class="{{tbody-class}}">
{{!-- filled by view-table-row-template --}}
@code-for-coffee
code-for-coffee / ch3-table-row-view.hbs
Created February 4, 2015 05:52
Backbone Enterprise Practices - Ch3 Table Row View
{{!-- view-table-row-template --}}
<tr>
{{#each column}}
<td>{{this}}</td>
{{/each}}
</tr>
{{!-- end view-table-row-template --}}