Skip to content

Instantly share code, notes, and snippets.

View scottcorgan's full-sized avatar
💭
Not coding

Scott Corgan scottcorgan

💭
Not coding
  • Tamarack
  • Shelbyville, KY
View GitHub Profile
@scottcorgan
scottcorgan / backbone-view-requirejs-module.js
Created August 8, 2012 17:35
Backbone View in a Requirejs Module
define(
[
// Dependencies
'text!someTemplate.html'
],
function(someTemplateTpl){
return Backbone.View.extend({
// Set the id if you are creating this element from scratch
// If the element already exists, use el: '#someView' to
@scottcorgan
scottcorgan / home.js
Created August 8, 2012 18:00
HomeView
// I encourage you to attach all these views to a global object named 'App'
/*
// You should put this in the index.html file towards the top
window.App = {};
*/
// This is better because then it's now attached to the global namespace
@scottcorgan
scottcorgan / QWrapper.js
Created December 18, 2012 20:07 — forked from anonymous/QWrapper.js
Function wrapper to avoid creating a new deferred in every function using the Q (http://documentup.com/kriskowal/q) library.
/*
Function wrapper to avoid creating a new deferred in every function
using the Q (http://documentup.com/kriskowal/q) library.
*/
// Wrapper Function
function _q (callback) {
return function () {
var deferred = Q.defer(),
args = [].slice.call(arguments, 0);
@scottcorgan
scottcorgan / async_anything.js
Created December 22, 2012 00:35
Async anything
function (foo, callback) {
process.nextTick(function() {
var error = null, data;
try {
data = JSON.parse(foo);
}
catch (ex) {
error = ex;
}
@scottcorgan
scottcorgan / gist:5461966
Last active December 16, 2015 16:19
CommonJS dot dot slash example
var SomeModule = require('../../some/directory/module');
// Perform tests on SomeModule here
// Module definition
module.exports = function () {
console.log('in my module');
};
/////////////////////////////////////////////////////////////////
// Somewhere else in your codebase
// Module definition
// inject <~~ that's how you declare a module file injectable for Injector
exports.YourModule = function () {
return function () {
console.log('in my injectable module');
};
};
nv = env\n</li>\n \n <li onclick="toggle(\'pre70352448150660\', \'post70352448150660\')"> before\n</li>\n \n <li onclick="toggle(\'pre70352448150660\', \'post70352448150660\')"> @app_response = @app.call(@env)\n</li>\n \n </ol>\n \n\n <ol start="25" class="context-line">\n <li onclick="toggle(\'pre70352448150660\', \'post70352448150660\')"> after || @app_response<span>...</span></li></ol>\n\n \n <ol start=\'26\' class="post-context" id="post70352448150660">\n \n <li onclick="toggle(\'pre70352448150660\', \'post70352448150660\')"> end\n</li>\n \n <li onclick="toggle(\'pre70352448150660\', \'post70352448150660\')">\n</li>\n \n <li onclick="toggle(\'pre70352448150660\', \'post70352448150660\')"> # @abstract\n</li>\n \n
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="NONE,NOARCHIVE" />
<title>PublicSuffix::DomainInvalid at &#x2F;apps</title>
<style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
body * * { padding:0; }
Creating build ... done
Deploying build ...
===> Ready to Extract Tape Archive... (spinning up read head and platter)
===> Released index.html
===> Released bower_components/angular/.bower.json
===> Released Gruntfile.js
===> Released .DS_Store
===> Released bower_components/angular/bower.json
===> Released bower_components/jquery/jquery-migrate.js