Skip to content

Instantly share code, notes, and snippets.

@bcomnes
bcomnes / Tron Legacy.terminal
Last active May 28, 2019 15:05
Tron Legacy Terminal Profile
<?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>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjEwOTA5NTk4MjEgMC4xMDkwOTU5ODIxIDAuMTA5MDk1OTgyMQAQAYAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
@bcomnes
bcomnes / README.md
Last active February 28, 2019 23:23
go-swagger bug

A possible go-swagger bug

The request object that github.com/go-openapi/runtime implements has a .GetBody method. When you run the .GetBody method, it writes the ClientRequestWriterFunc to the req.Body again.

usage

With Go 1.12 installed:

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
bcomnes / Jenkinsfile
Created December 8, 2018 00:59
Git env vars you might need in jenkins
/*
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.GIT_BRANCH: same as BRANCH_NAME
env.TAG_NAME: the tag name of the current build, when it exists
*/
node_modules
coverage
.nyc_output
@bcomnes
bcomnes / launch.json5
Last active March 11, 2018 18:44
How to set up vs code debugger with a run script
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_launch-configuration-support-for-npm-and-other-tools
"version": "0.2.0",
"configurations": [
{
"name": "Launch via test NPM",
"type": "node",

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).

To

@bcomnes
bcomnes / idb-dat-storage.js
Created January 18, 2018 21:35 — forked from creationix/idb-dat-storage.js
A simple abstract-random-access implementation using indexed DB that takes advantage of hypercore's behavior or consistent boundaries/offsets.
/* eslint-env browser */
var Buffer = require('buffer').Buffer
var name = 'dat'
function withStore (type, block, callback) {
var req = indexedDB.open(name + '-db', 1)
req.onerror = () => callback(req.error)
req.onupgradeneeded = () => req.result.createObjectStore(name)
req.onsuccess = () => {
@bcomnes
bcomnes / cloudSettings
Last active January 29, 2018 17:48
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-01-05T23:15:02.658Z","extensionVersion":"v2.8.7"}