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
// a la http://chariotsolutions.com/blog/post/angularjs-corner-using-promises-q-handle-asynchronous-calls/ | |
// http://www.webdeveasy.com/interceptors-in-angularjs-and-useful-examples/ | |
angular | |
.module('movie') | |
.factory('movieService', function ($http, $log, $q) { | |
return { | |
getMovie: function (movie) { | |
var deferred = $q.defer(); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Sandbox</title> | |
<script src="//code.jquery.com/jquery-2.1.1.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.4/angular.js"></script> | |
<script src="//code.highcharts.com/stock/highstock.src.js"></script> | |
</head> | |
<body ng-app="app"> |
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
<!doctype html> | |
<html lang="en" ng-app="app"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Sandbox</title> | |
<script src="//code.jquery.com/jquery-2.1.1.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.4/angular.js"></script> | |
</head> | |
<body> | |
<div ng-controller="sandboxCtrl as sandbox"> |
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
function count(type) { | |
var counter = 0; | |
return through(function countFiles(data) { | |
counter++; | |
this.queue(data); | |
}, function endStream() { | |
console.log(' ' + counter + ' ' + type + ' files processed'); | |
this.queue(null); | |
}); | |
} |
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
// problem: beeper uses setTimeouts() for multiple beeps yet has no callback | |
// solution: return a promise for when beeping is done | |
var beeper = require('beeper'), | |
_ = require('lodash'), | |
q = require('q') | |
; | |
function beep(count) { | |
return q.all(_.times(typeof count === 'undefined' ? 1 : count, function (n) { |
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
// problem: the order of the files it finds can be different each time glob searches the exact same path | |
// solution: use synchronous globbing instead | |
var _ = require('lodash'), | |
glob = require('glob') | |
; | |
function deglob() { | |
var syncGlob = glob.sync, | |
patterns = _.flatten(arguments, true); |
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
http://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title></title> | |
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> | |
<script type='text/javascript' src="http://code.jquery.com/jquery-1.11.3.js"></script> | |
<script type='text/javascript' src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> | |
<script type='text/javascript' src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.0/angular.js"></script> | |
</head> |
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
https://gist.github.com/CMCDragonkai/6282750 |
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
http://blog.workshape.io/making-a-spherical-globe-using-d3js/ |
OlderNewer