Skip to content

Instantly share code, notes, and snippets.

Darren Beukes mr-beerkiss

View GitHub Profile
View fetchData.js
// I find MDN have the best resources for most JS stuff: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
// using async/await
(async function() {
// when using await, the function in the outer scope must be declared `async` otherwise it won't work and
// you'll get very mysterious error messages
try {
const response = await fetch('some/url');
// response.ok is generally a status code between 200 & 299
if (response.ok) {
let data;
@mr-beerkiss
mr-beerkiss / s3-bucket-name-generator.js
Created Jul 9, 2017
Utility to generate meaningful, unique S3 bucket names
View s3-bucket-name-generator.js
// Requires Node 8
// Usage node index.js your-bucket-name
const promisify = require("util").promisify;
const shasum = require("shasum");
const randomBytes = promisify(require("crypto").randomBytes);
(async () => {
try {
View keybase.md

Keybase proof

I hereby claim:

  • I am mr-beerkiss on github.
  • I am mr_beerkiss (https://keybase.io/mr_beerkiss) on keybase.
  • I have a public key whose fingerprint is 69BB B155 19D2 9DFF 1E54 96D9 F7FB 32DB 35C9 B37C

To claim this, I am signing this object:

@mr-beerkiss
mr-beerkiss / readme.md
Created Jul 13, 2016 — forked from vbence86/readme.md
Release Smash-website to Development
View readme.md
@mr-beerkiss
mr-beerkiss / webpack.js
Created Nov 24, 2015 — forked from Couto/webpack.js
Fetch polyfill with webpack
View webpack.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
You can’t perform that action at this time.