Skip to content

Instantly share code, notes, and snippets.

View Crowbrammer's full-sized avatar
🌎
Grateful

Aaron Bell Crowbrammer

🌎
Grateful
View GitHub Profile
@ncochard
ncochard / babel-webpack.md
Last active September 29, 2023 05:15
The correct way to compile ES6 using babel...

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:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. 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.
@kohyama
kohyama / factorize.clj
Last active May 18, 2022 02:20
Prime Factorization in Clojure
(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)))
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt