Skip to content

Instantly share code, notes, and snippets.


Bret bcomnes

View GitHub Profile
bcomnes / .gitignore
Last active Jan 1, 2020
View .gitignore
View get-form-values.js
function getFormValues (formEl) {
return Array.from(new window.FormData(formEl).entries())
.reduce(function (obj, [key, value]) {
obj[key] = value
return obj
}, {})
bcomnes / Tron Legacy.terminal
Last active May 28, 2019
Tron Legacy Terminal Profile
View Tron Legacy.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
bcomnes /
Last active Feb 28, 2019
go-swagger bug

A possible go-swagger bug

The request object that implements has a .GetBody method. When you run the .GetBody method, it writes the ClientRequestWriterFunc to the req.Body again.


With Go 1.12 installed:

View promise-backoff.js
var pause = (duration) => new Promise(res => setTimeout(res, duration));
var exponentialBackoff = (func, attempts = 1, delay = 50) => {
console.log('attempts', attempts)
return func().catch(err => {
console.log('error', err)
if (attempts > 1) {
console.log(`Retries left ${attempts - 1}`)
console.log(`Next delay ${delay * 2}`)
return pause(delay).then(() => exponentialBackoff(func, attempts - 1, delay * 2))
bcomnes / Jenkinsfile
Created Dec 8, 2018
Git env vars you might need in jenkins
View Jenkinsfile
Jenkins ENV Reference:
env.GIT_COMMIT: the commit sha of the current build
env.BRANCH_NAME: the branch name OR tag name of the current build, when it exists
env.TAG_NAME: the tag name of the current build, when it exists
View .gitignore
bcomnes / launch.json5
Last active Mar 11, 2018
How to set up vs code debugger with a run script
View launch.json5
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
"version": "0.2.0",
"configurations": [
"name": "Launch via test NPM",
"type": "node",
View gist:12d7bb78088159dee24a642c8a96bb6f

Epistle 3

I hope this letter finds you well. I can hear your complaint already, “Gordon Freeman, we have not heard from you in ages!” Well, if you care to hear excuses, I have plenty, the greatest of them being I’ve been in other dimensions and whatnot, unable to reach you by the usual means. This was the case until eighteen months ago, when I experienced a critical change in my circumstances, and was redeposited on these shores. In the time since, I have been able to think occasionally about how best to describe the intervening years, my years of silence. I do first apologize for the wait, and that done, hasten to finally explain (albeit briefly, quickly, and in very little detail) events following those described in my previous game (referred to herewith as Episode 2).