This file contains hidden or 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 five = require("johnny-five"); | |
var ports = [ | |
{ id: "Alf", port: "/dev/tty.Alf-DevB"}, | |
{ id: "Joystick", port: "/dev/tty.usbmodem1451" } | |
]; | |
var boards = five.Boards(ports); | |
var normalizedPosition = { x: 0, y: 0 }; |
This file contains hidden or 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
grunt.initConfig({ | |
concat: { | |
dist: { | |
src: ['src/*.js'], | |
dest: 'dist/app.js', | |
options: { | |
process: wrapInIIFE | |
} | |
}, | |
}, |
This file contains hidden or 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
App.factory('rickAstley', function() { | |
var messages = [ | |
'Never gonna give you up', | |
'Never gonna let you down', | |
'Never gonna run around and desert you', | |
'Never gonna make you cry', | |
'Never gonna say goodbye', | |
'Never gonna tell a lie and hurt you' | |
]; |
This file contains hidden or 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
<div ng-click="toggle()" class="hampster-dance"> | |
<img src="/img/hampster.jpeg" ng-show="!animated" /> | |
<img src="/img/animated-hampster.gif" ng-show="animated" /> | |
<embed src="/audio/hampster-dance.wav" ng-show="animated"> | |
</div> |
This file contains hidden or 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
public class VariablesController : ApiController | |
{ | |
public IEnumerable<Variable> Get() | |
{ | |
// get all | |
} | |
[Route("api/variables/{id}")] | |
public Variable Get( int id ) | |
{ |
This file contains hidden or 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
App.directive('whatDoesTheFoxSay', function() { | |
return { | |
link: function(scope, element, attrs) { | |
scope.message = "What does the fox say?"; | |
element.click(function() { | |
scope.$apply(function() { | |
scope.message = "Wa-pa-pa-pa-pa-pa-pow!"; | |
}); | |
}); |
This file contains hidden or 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
_($('.ng-scope')) | |
.map(function(scopeElement) { return angular.element(scopeElement).scope().$$watchers; }) | |
.flatten(true) | |
.uniq() | |
.filter(function(x) { return !!x; }) | |
.value() | |
.length; |
This file contains hidden or 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
app.directive('myIf', ['$animate', function($animate) { | |
return { | |
transclude: 'element', | |
priority: 1000, | |
terminal: true, | |
restrict: 'A', | |
compile: function (element, attr, transclude) { | |
return function ($scope, $element, $attr) { | |
var childElement, childScope; | |
$scope.$watch($attr.myIf, function ngIfWatchAction(value) { |
This file contains hidden or 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
module.config(function($templateCache) { | |
$templateCache.put('template.html', '<b>Bad ass</b> template'); | |
}); |
This file contains hidden or 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
angular.module('httpProgress') | |
.factory('httpProgressInterceptor', function($q) { | |
var requestCount = 0; | |
function updateProgress(update) { | |
var previous = requestCount; | |
requestCount += update; | |
if(previous <= 0 && requestCount > 0) { | |
NProgress.start(); |