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 Q = require('q'), | |
fs = require('fs'); | |
Q.longStackSupport = true; | |
var filterLargeFilename = function (array) { | |
var length = 10; | |
return array.filter(function (name) { | |
return (name.length <= length); |
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 crypto = require('crypto'), | |
cuid = require('cuid'), | |
string, | |
zeros = 0, | |
currentHash = '', | |
currentZeros = 0, | |
hash; | |
function findZeros(hash) { | |
var chars = hash.split(''), |
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 VigenèreCipher(key, abc) { | |
var keyLen = key.length, | |
abcLen = abc.length - 1, | |
abcObj, | |
abcToObject; | |
key = key.split(''); | |
abc = abc.split(''); | |
abcToObject = function (abc) { |
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 _ = require('highland'), | |
request = require('request'); | |
// This works but not using the stream approach | |
// function get(path) { | |
// return _(function (push, next) { | |
// request(path, function (error, response, body) { | |
// // The response itself also contains the body |
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
db.findById(id, function (err, res) { | |
if (err) { | |
return cb(err); | |
} | |
// Handle result | |
return cb(null, _.transform(res)); | |
}); |
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> | |
<title>Test websocket</title> | |
</head> | |
<script type="text/javascript"> | |
var context = new webkitAudioContext(); | |
var ws = new WebSocket("ws://localhost:8080"); | |
var startTime = context.currentTime; |
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 amqp = require('amqp'), | |
C = require('config'), | |
config = C.server, | |
connection; | |
connection = amqp.createConnection({ | |
url: config.rabbitmq.url | |
}); | |
connection.on('ready', 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
Show hidden characters
{ | |
"folders": | |
[ | |
{ | |
"path": "app-api-new", | |
"follow_symlinks": true, | |
"name": "API", | |
}, | |
{ | |
"path": "app-new-fe", |
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
#!/bin/bash | |
# split image file (flac, ape, wav, etc.) according to cue-file | |
if [ -f "$1" ]; then | |
i=0 | |
for cuefile in *.cue; do | |
i=$(($i + 1)) | |
done | |
if [ $i -eq 1 ]; then | |
# precies 1 cuesheet gevonden |
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 a = [1,2,3] | |
// Using lodash or underscore | |
var b = _.clone(a); | |
var c = Array.prototype.slice.call(a, 0); | |
var d = a.concat() |
OlderNewer