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
//process n number of async functions in order. used when promises aren't viable e.g. cross file or service calls. | |
var TaskQueue = function(){ | |
var queue = [], | |
isProcessingQueue = false, | |
commonState = { task: 0 }; | |
function add(fn){ | |
queue.push(fn); |
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
.directive('smelly', function(){ | |
return { | |
restrict: 'E', | |
controller: function(){ | |
this.doWork = function(){ | |
alert('smelly work'); | |
}; | |
}, | |
link: function($scope, $element, $attributes, controller){ | |
$element.bind('click',function(){ |
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
<html ng-app="mymodule"> | |
<head></head> | |
<body ng-controller="AppController"> | |
</body> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.10/angular.min.js"></script> | |
<script> | |
//http://stackoverflow.com/questions/15666048/angular-js-service-vs-provider-vs-factory | |
angular.module( 'mymodule', []) |
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
.directive('stinky', function(){ | |
return { | |
transclude: true, | |
template: "<div>hello <span ng-transclude></span></div>", | |
link: function($scope, $element, $attributes, $compile){ | |
} | |
}; | |
}) |
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
var canvas = document.getElementById('canvas'); | |
var context = canvas.getContext("2d"); | |
var started = false; | |
var crayonTextureImage = new Image(); | |
function init () { | |
canvas.addEventListener('mousemove', mousemove, false); | |
canvas.addEventListener('mousedown', mousedown, false); | |
canvas.addEventListener('mouseup', mouseup, false); | |
crayonTextureImage.src = "Penguins.jpg"; |
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
<style> | |
.rating { | |
unicode-bidi: bidi-override; | |
direction: rtl; | |
} | |
.rating > span { | |
display: inline-block; | |
position: relative; | |
width: 1.1em; | |
} |
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
var express = require('express'); | |
var app = express(); | |
var oneDay = 0;//86400000; | |
app.configure(function(){ | |
app.use(express.compress()); | |
app.use(express.static(__dirname + '/public', { maxAge: oneDay })); | |
app.use(express.bodyParser()); | |
app.use(express.cookieParser('some secret')); | |
}); |
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
var httpProxy = require('http-proxy'); | |
var options = { | |
pathnameOnly: true, | |
// this list is processed from top to bottom, so '.*' will go to | |
// '127.0.0.1:3000' if the Host header hasn't previously matched | |
router : { | |
'/api': '127.0.0.1:4271', | |
//'': '127.0.0.1:3002', | |
//'^.*\.sample\.com': '127.0.0.1:3002', |
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
.controller( 'AboutCtrl', function AboutCtrl( $scope ) { | |
$scope.doWork = function(){ | |
alert('working'); | |
}; | |
}) | |
.directive('stinky', function(){ | |
return { | |
link: function($scope, $element, $attributes, $compile){ | |
$element.bind("click", function(){ | |
$scope.$apply($attributes.stinky); |
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
/* | |
High level directory structure | |
root/ | |
application/ (configuration) | |
domain/ (business logic) | |
Entities/ (User, Article, Image, Video) | |
Aggregates/ (UserProfile, UserHistory) | |
ValueObjects/ | |
dataAccess/ (repositories for data retrieval/persistance) |
OlderNewer