- requires
- name
- provider
- factory
- service
- 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
http://www.smartjava.org/content/html5-easily-parallelize-jobs-using-web-workers-and-threadpool | |
function Pool(size) { | |
var _this = this; | |
// set some defaults | |
this.taskQueue = []; | |
this.workerQueue = []; | |
this.poolSize = size; | |
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 fs = require('fs'); | |
var path = '/home/tknew/.forever/out-probe2.log'; | |
var colors = [ | |
'\x1B[34m', | |
'\x1B[36m', | |
'\x1B[32m', | |
'\x1B[35m', | |
'\x1B[31m', |
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 foreverMonit = require('forever-monitor'); | |
var forever = require('forever'); | |
var child = new (foreverMonit.Monitor)('./toto.js', { | |
max: 3, | |
silent: false, | |
options: [], | |
sourceDir : '.', | |
pidFile : 'pid/app.pid' | |
}); |
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
function asyncGreet(name) { | |
var deferred = $q.defer(); | |
setTimeout(function() { | |
// since this fn executes async in a future turn of the event loop, we need to wrap | |
// our code into an $apply call so that the model changes are properly observed. | |
scope.$apply(function() { | |
if (okToGreet(name)) { | |
deferred.resolve('Hello, ' + name + '!'); | |
} else { |
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-directive ng-animate="{enter: 'animate-enter'}"></div> | |
- * .animate-enter-setup { | |
* -webkit-transition: 1s linear all; /* Safari/Chrome */ | |
* -moz-transition: 1s linear all; /* Firefox */ | |
* -ms-transition: 1s linear all; /* IE10 */ | |
* -o-transition: 1s linear all; /* Opera */ | |
* transition: 1s linear all; /* Future Browsers */ | |
* | |
* /* The animation preparation code */ | |
* opacity: 0; |
Revised date: 07/11/2012
Between us [company name] and you [customer name]
We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.
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 util = require('util'); | |
var fs = require('fs'); | |
var log = fs.createWriteStream('stdout.log'); | |
console.log = console.info = function(t) { | |
var out; | |
if (t && ~t.indexOf('%')) { | |
out = util.format.apply(util, arguments); | |
process.stdout.write(out + '\n'); | |
return; |
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 __ = require("../maki/lib/underscore.js"); | |
var events = require("events"); | |
var Stream = require('./events_caller.js').MyStream; | |
var stream = new Stream(); | |
console.log(stream instanceof events.EventEmitter); // true | |
console.log(Stream.super_ === events.EventEmitter); // true | |
stream.on("data", function(data) { |
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
rec -c 2 -r 16000 -s -t wav - | flac - -f --best --sample-rate 16000 -o out.flac | |
#arecord -f cd -t wav -d 5 -r 16000 | flac - -f --best --sample-rate 16000 -o out.flac | |
wget --post-file='out.flac' --header='Content-Type: audio/x-flac; rate=16000;' \ | |
-O 'recognized.json' \ | |
'https://www.google.com/speech-api/v1/recognize?lang=fr-FR' | |
ll |
NewerOlder