Skip to content

Instantly share code, notes, and snippets.

@simondch
simondch / readme.md
Created February 18, 2021 16:25
delete node_modules recursively

Linux / Mac OS

List

find . -name "node_modules" -type d -prune | xargs du -chs

Delete

find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@bwinant
bwinant / lifecycle-plugin.js
Created May 7, 2018 09:04
Serverless Plugin Lifecycle Events
'use strict';
// This plugin will bind to all available lifecycle events and print them out as they are invoked
class LifecyclePrinter {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.provider = this.serverless.getProvider('aws');
@skratchdot
skratchdot / arrayBufferToString.js
Created March 3, 2016 04:43
Array Buffer -> String and String -> ArrayBuffer conversions in javascript
// source: http://stackoverflow.com/a/11058858
function ab2str(buf) {
return String.fromCharCode.apply(null, new Uint16Array(buf));
}