Convert and transcode:
ffmpeg -i in.mkv out.mp4
Covert without transcoding:
| var foo = require('foo'); | |
| var next = foo(function (err, results) { | |
| err // => the first error thrown | |
| results // => array of all the results | |
| }); | |
| doSomething(next()); | |
| doSomethingElse(next()); | |
| anotherThing(next()); |
| // the data | |
| var arr = ['foo', 'bar', 'baz']; | |
| // the formal way | |
| arr.filter(function (elm) { | |
| return /a/.test(elm); | |
| }); | |
| // the one-liner | |
| arr.filter(RegExp.prototype.test.bind(/a/)); |
| function isArray(ar) { | |
| return Array.isArray(ar) || | |
| (typeof ar === 'object' && objectToString(ar) === '[object Array]'); | |
| } |
| ~stackman% standard --version | |
| 4.3.1 | |
| ~stackman% standard | |
| ~stackman% mkdir /tmp/stackman | |
| ~stackman% cp -pr . /tmp/stackman | |
| ~stackman% cd /tmp/stackman | |
| ~stackman% standard | |
| standard: Use JavaScript Standard Style (https://github.com/feross/standard) | |
| /private/tmp/stackman/err1.js:1:13: Extra semicolon. | |
| /private/tmp/stackman/err1.js:3:29: Extra semicolon. |
| var http = require('http') | |
| var asyncState = require('async-state') | |
| process.on('uncaughtException', function (err) { | |
| if (asyncState.req) { | |
| console.log('An error occurred while processing request for', asyncState.req.url) | |
| } else { | |
| console.log('An error occurred outside of an HTTP request') | |
| } | |
| }) |
Find all files excluding a single directory:
find . -path ./exclude-this -prune -o -type f -name '*.js' -print
Notes:
-path ./exclude-this -prune -o part ensures that the path ./exclude-this isn't included-print part ensures that the base directory of the excluded path isn't outputtet (this isn't needed if combining with -exec)The standard code style linter is a great tool by Feross - check it out!
Remove trailing semicolons:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/;$//' {} \;
Ensure space between function and opening bracket: