Skip to content

Instantly share code, notes, and snippets.

View AaronNGray's full-sized avatar

Aaron Gray AaronNGray

View GitHub Profile
@AaronNGray
AaronNGray / gitprint.js
Created April 16, 2020 23:39 — forked from beevelop/gitprint.js
Print GitHub markdown files
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white')
document.querySelector('body').appendChild(document.querySelector('#readme'))
window.print()
@AaronNGray
AaronNGray / npm_lazy.md
Created October 6, 2019 19:19
How to install npm_lazy as a Mac OS X Launcher from the command line.

How to install npm_lazy as a Mac OS X Launcher from the command line.

NOT TESTED YET

Install npm_lazy globally :-

npm install -g npm_lazy

Create the configuration file :-

How to install verdaccio as a Mac OS X Launcher from the command line.

NOT TESTED YET

Install verdaccio globally :-

npm install -g verdaccio
# /Users/user/Scripts/npm_lazy.sh
#!/bin/sh
npm_lazy --config --config ~\npm_lazy.config.js
@AaronNGray
AaronNGray / org.verdaccio.launcher.plist
Last active October 6, 2019 18:35 — forked from juanpicado/org.verdaccio.launcher.plist
verdaccio on mac as a service
# ~/Library/LaunchAgents/org.verdaccio.launcher.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.verdaccio.launcher</string>
<key>Program</key>
<string>/Users/user/Scripts/verdaccio.sh</string>
<key>RunAtLoad</key>

How to install verdaccio as a Windows Service from the command line.

Download NSSM and install it in a directory on the path.

Install npm_lazy :-

npm install -g verdaccio

How to install npm_lazy as a Windows Service from the command line.

Download NSSM and install it in a directory on the path.

Install npm_lazy and create a configuration file :-

npm install -g npm_lazy
npm_lazy --init > "%userprofile%/npm_lazy.config.js"
FireFox :-
data:application/pdf;charset=binary;base64,JVBERi0xLjQKJdDUxdgKNCAwIG9iaiA8PAovTGVuZ3RoIDExOTcgICAgICAKL0ZpbHRlciAvRmxhdGVEZWNvZGUKPj4Kc3RyZWFtCnjanVZNb9tGEL3rV2xPpYByvV/cDxQ9NKkDpHCABNahQJwDLa2sbUhRIak46aV/vbOcpUzZtFv0InFnhzNv3ryd5avV4uIN10QwqrUoyGpLhFaUs4JoVlAnLFltyMdstfy0+p1w8JKK5IoqlTYuTxtckIn9jyp8XQqdefpnF10giyFcUam0iFlybalzkuSyoMoJfOl168veb5a5hDdvl8Jk3/H5XbmPq6OvcH29jsvd30tlXdZUVdjfDTikoNw6kgtLmVIY9Nofel9H/9tlDr++xRjqp/hvMsGWPOPuASSnrigQJAde+FCxAqOZcqFpwQC+oIWRUyqinZOJGZkwyEQuXZGF4V9lJS7XTX0I1QALVtumxd1+59GSuNcRin4mozjLiO/1A4EHLLrzfR9ZGkIf2uauLeuU/kQ6LI7dSGXOnaECSsl5bKvG0O+av0JVlT/GCozMLutu3Qbgd4/r16kUuswLU2RvezQ3N4xL36aXUva6vK08Wja++9w3h7QN7TjeVqHbjVBYwlAghi3gPbZ+iKazcr/BB/8NYHSJazRty3WoQh9GX+TWmKw89k1dQqLECZjqputTxC5xtu7Te80WfYBR+4TRKcLE0oBJSf5QWFwcTlWB8lRhsrBfV8fNgEBJke1j9OOZUtMef4i4bpuuy1u/9a3fr8dYNusjm92zYKRyGTRB3UXiovALUEF553GnKofCYubm2A/bRXYbgB9AHJt12IX0WjHGs9mA9IgnEePUTetj65nA1oOpOx6Qr6Yd2ATTFR41IYihzoDC4KRJDSfXGFCxEUnFv86dSEULa+IZOLk9OY1q/jSq8WwM4pbGUaPtOVP3u3CqRojsPj6XEbQACbfhLuyjZ
// code from https://tech.mybuilder.com/handling-retries-and-back-off-attempts-with-javascript-promises/
const pause = (duration) => new Promise(res => setTimeout(res, duration));
const retry = (self, fn, args, retries, delay = 500, factor = 2) =>
fn.apply(self, args).catch(err => retries > 1
? pause(delay).then(() => retry(self, fn, args, retries - 1, delay * factor, factor))
: Promise.reject(err));
module.exports = retry;
@AaronNGray
AaronNGray / Features.js.txt
Last active October 3, 2018 16:44
General patterns for creating windows feature Polyfills
"use strict";
(scope => {
...code...
// exports
scope.X = X;
scope.Y = Y;
})(window.Feature = (window.Feature || {}));