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
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
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
(defn factorize [n] | |
((fn f [n [h & r :as ps]] | |
(cond (< n 2) '() | |
(zero? (mod n h)) (cons h (lazy-seq (f (quot n h) ps))) | |
:else (recur n r))) | |
n prime-numbers))) |
When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:
- Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
- Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
- Is it going to be used as a dependency to a browser application (always bundled)?.
- In cases 2) and 3) you want to allow for tree shaking.
- In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
- In case 3) you also want to benefit from the native support of "ES6" from your browser.