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
| #!/bin/bash | |
| for file in ./recup_dir*/*.mp4 | |
| do | |
| mv ${file} mp4 | |
| done |
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
| tar -zcvf project.tgz --exclude "./project/node_modules" ./project |
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
| /* global __dirname */ | |
| var fs = require('fs'); | |
| var files = fs.readdirSync(__dirname).filter(isAConfigFile); | |
| var configs = files.map(file => require(__dirname + '/' + file)); | |
| function isAConfigFile(filename) { | |
| return filename.endsWith('-config.js'); | |
| } |
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
| def render(s: String, mode: NameMode): String = | |
| if (s.matches("\\d+")) { | |
| return render(SafeLong(s.toInt), mode); | |
| // The line below seems to compile. | |
| } else if (s.charAt(0) == '-') { | |
| "negative " + render(s.substring(1).toInt, mode) | |
| } else if (s.length < 2) { | |
| val c = s.charAt(0) | |
| if (charIsAlpha(c)) { | |
| onesForChar(c) |
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 curry = require('lodash.curry'); | |
| var counts = [9, 4, 4, 5, 49]; | |
| var avgCount = mean(counts); | |
| var deviations = counts.map(curry(bMinusA)(avgCount)); | |
| var squaredDevs = deviations.map(square); | |
| var variance = mean(squaredDevs); | |
| var populationStdDev = Math.sqrt(variance); | |
| console.log('avgCount', avgCount); | |
| console.log('populationStdDev', populationStdDev); |
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
| /* global __dirname, process */ | |
| var fs = require('fs'); | |
| var ndjson = require('ndjson'); | |
| var through2 = require('through2'); | |
| var callNextTick = require('call-next-tick'); | |
| if (process.argv.length < 3) { | |
| console.log( | |
| 'Usage: node tools/toolname.js <export something.ndjson> > new_file.ndjson' |
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 hash = require('string-hash'); | |
| function TrackingColors() { | |
| var idsForColors = {}; | |
| return { | |
| getTrackingColorForId, | |
| getIdForTrackingColor | |
| }; | |
| function getTrackingColorForId(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
| # Usage: ZEROES=9 make number-audio | |
| # e.g. A million has six zeroes (3 * (1 + 1)). | |
| # A billion has nine zeroes (3 * (2 + 1)). | |
| # A trillion has 12 zeroes (3 * (3 + 1)). | |
| number-audio: | |
| rm -f output.wav | |
| rm -f test-list.txt | |
| echo "file static/one.wav\n" > test-list.txt | |
| for i in {1..$(ZEROES)}; do printf "file 'static/zero.wav'\n" >> test-list.txt; done | |
| ffmpeg -f concat -safe 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
| var width = +window.innerWidth; | |
| var height = +window.innerHeight; | |
| svg.attr('width', width); | |
| svg.attr('height', height); |
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 names = []; var items = document.querySelectorAll('.game .title'); for (var i = 0; i < items.length; ++i) { names.push(items[i].textContent); } console.log(JSON.stringify(names, null, 2)); |