Skip to content

Instantly share code, notes, and snippets.

Aaron Gray AaronNGray

Block or report user

Report or block AaronNGray

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View retry.js
// 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 Oct 3, 2018
General patterns for creating windows feature Polyfills
View Features.js.txt
"use strict";
(scope => {
...code...
// exports
scope.X = X;
scope.Y = Y;
})(window.Feature = (window.Feature || {}));
View EdgeError.html
<!DOCTYPE html>
<html>
<head>
<!-- Copyright (c) 2018 Aaron Nathaniel Gray -->
<script>
document.addEventListener('WebComponentsReady', function() {
console.log("WebComponentsReady", Math.round(performance.now()));
document.body.appendChild(
document.createTextNode("WebComponentsReady: " + Math.round(performance.now()) + "ms")
);
View introspection-query.graphql
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@AaronNGray
AaronNGray / uEnv.txt
Created Jun 14, 2018
BPI-M3 SATA boot (not working)
View uEnv.txt
#
## uEnv.txt
#
bpi=bananapi
board=bpi-m3
chip=a83t
service=linux
#
#
#fex2bin sys_config.fex > script.bin
@AaronNGray
AaronNGray / stretch.input
Created Jun 8, 2018
Stretch update keyboard input file
@AaronNGray
AaronNGray / stretch.sh
Last active Jun 8, 2018
Raspbian 'Stretch' upgrade
View stretch.sh
cat >stretch.in <<EOF
Y
Y
Y
Q
EOF
cp /etc/apt/sources.list /etc/apt/sources.list.jessie
sed -e "s/jessie/stretch/g" /etc/apt/sources.list >/etc/apt/sources.list.stretch
@AaronNGray
AaronNGray / make.sh
Last active Jun 13, 2018
make.sh for making SSD from SDCard root
View make.sh
cp -r /bin /mnt/sda2
cp -r /boot /mnt/sda2
#cp /dev /mnt/sda2
cp -r /etc /mnt/sda2
cp -r /home /mnt/sda2
cp -r /lib /mnt/sda2
cp -r /lost+found /mnt/sda2
cp -r /man /mnt/sda2
#cp -r /media /mnt/sda2
#cp -r /mnt /mnt/sda2
@AaronNGray
AaronNGray / fstab
Created Jun 7, 2018
/etc/fstab for BananaPi Raspbian Stretch with SATA SSD
View fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/sda2 / ext4 errors=remount-ro 0 1
/dev/sda3 none swap sw 0 0
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
@AaronNGray
AaronNGray / docker-clone&build&push
Last active Jun 2, 2018
build a Docker GitHub repo and push to docker.io
View docker-clone&build&push
build a Docker image from a GitHub repo and push to docker.io :-
sudo docker build -t aaronngray/bpi-build:bpi-build github.com/AaronNGray/bpi-build
sudo docker push aaronngray/bpi-build
You can’t perform that action at this time.