Skip to content

Instantly share code, notes, and snippets.

View stacylondon's full-sized avatar

Stacy London stacylondon

View GitHub Profile
@stacylondon
stacylondon / app-measurement-template.tmpl
Last active May 3, 2016 02:22
Jasmine Custom Templates - Runner HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner</title>
<% css.forEach(function(style){ %>
<link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %>
<% with (scripts) { %>
@stacylondon
stacylondon / app-measurement-template.js
Created May 3, 2016 00:20
Jasmine Custom Templates - Template
var template = './tests/template/app-measurement-template.tmpl';
exports.process = function(grunt, task, context) {
var packageJson = grunt.file.readJSON('package.json');
var myLibrary = './AppMeasurment';
var myLibraryVersion = packageJson.version + '.js';
if (context.options.minified) {
myLibrary += '.min-' + myLibraryVersion;
@stacylondon
stacylondon / Gruntfile.js
Last active May 3, 2016 00:18
Jasmine Custom Templates - Grunt Configuration
jasmine: {
unmodified: {
options: {
vendor: [
'vendor/jquery-1.11.0.min.js',
'tests/lib/jasmine-jquery-2.1.0.js'
],
specs: ['tests/spec/app-measurement-spec.js'],
template: require('./tests/templates/app-measurement-template.js'),
templateOptions: {
@stacylondon
stacylondon / refactor-06-mini-spa.js
Created May 11, 2015 23:10
Refactor 6 - Mini-SPA
// -------------------------------------
// PAGE TEMPLATE ***********************
// -------------------------------------
// -------------------------------------
// my-app.js
// -------------------------------------
define('app', function(require, exports, module) {
@stacylondon
stacylondon / refactor-07-modules.js
Created May 11, 2015 23:08
Refactor 7 - Modules
// requireJS simplified commonJS wrapper
// do this so can use the commonJS style
// make switch to browserify easier
define('page-one-view', function(require, exports, module) {
'use strict';
var Backbone = require('backbone');
var PageOneView = Backbone.View.extend({
@stacylondon
stacylondon / refactor-05-ajax-vs-backbone.js
Created May 11, 2015 23:06
Refactor 5 - Backbone Models, Collections
// -------------------------------------
// hand-written ajax
// -------------------------------------
var PageOneView = Backbone.View.extend({
el: '#pageOneMainContainer',
initialize: function() {
this.getSomeData();
@stacylondon
stacylondon / refactor-03-backbone-views.js
Created May 11, 2015 23:04
Refactor 3 - Backbone Views
// -------------------------------------
// my-app.js
// -------------------------------------
var myApp = myApp || {};
(function($, myApp) {
'use strict';
@stacylondon
stacylondon / refactor-02a-namespace-obj-literal.js
Last active August 29, 2015 14:20
Refactor 2 - Add Namespace, Object Literal Notation - Commented
// -------------------------------------
// my-app.js
// -------------------------------------
// prefix with semi-colon as safety net against concatenated
// scripts and/or other plugins that are not closed properly
;
// check for existence of myApp in the global namespace
var myApp = myApp || {};
@stacylondon
stacylondon / refactor-02-namespace-obj-literal.js
Last active August 29, 2015 14:20
Refactor 2 - Add Namespace, Object Literal Notation
// -------------------------------------
// my-app.js
// -------------------------------------
;
var myApp = myApp || {};
(function($, myApp) {
'use strict';
@stacylondon
stacylondon / front-end-development-resources.md
Last active August 29, 2015 14:14
Front-End Development Resources