Skip to content

Instantly share code, notes, and snippets.

Brian Link cpsubrian

Block or report user

Report or block cpsubrian

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
cpsubrian / bookmarklet.js
Last active Oct 12, 2019
Test Bookmarklet -- Pinkify
View bookmarklet.js
javascript:(function(){var src="";document.body.appendChild(document.createElement('script')).setAttribute('src', src);})();
View .dockerignore
# add git-ignore syntax here of things you don't want copied into docker image
cpsubrian / index.html
Created Aug 30, 2017
MyWifi Debugging
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
cpsubrian / .env
Created May 12, 2017
Netlify Build Fails due to Private Dependencies
View .env
cpsubrian / upload.js
Last active Dec 2, 2018
Upload files to S3 via node aws-sdk (if aws-cli isn't easily installable)
View upload.js
// Put credentials in ~/.aws/credentials like:
// [default]
// aws_access_key_id = [key]
// aws_secret_access_key = [secret]
if (process.argv.length !== 5) {
console.log('Usage: node ./upload.js [filepath] [bucket] [key]')
cpsubrian / example.test.js
Created Mar 7, 2017
Chainable request helper for testing express apps with jest
View example.test.js
import request from './request'
// Your express app (or router).
import app from './app'
it('can serve requests', () => {
return request
.header({authorization: 'Bearer mytoken'})
cpsubrian / db.js
Last active Feb 21, 2020
Mock knex database for Jest
View db.js
/* eslint-env jest */
import _ from 'lodash'
import path from 'path'
import fs from 'fs'
import callsites from 'callsites'
import knex from 'knex'
import hash from 'object-hash'
import conf from '<conf>'
// Get the db config.
cpsubrian / regexSupplant.js
Created Jan 25, 2017
Create a regex from parts using a tagged template.
View regexSupplant.js
function regexSupplant (strings, ...values) {
let parts = []
while (strings.length || values.length) {
if (strings.length) {
.map((val) => val.trim())
cpsubrian /
Last active Mar 18, 2020
Compile Xvfb for AWS Lamba
cpsubrian /
Last active Nov 22, 2016
LetsEncrypt Auto Renewal Via Dgate

Note: You must edit [domain] and [dir] in the examples below.

Step 1. Double-check that dgate-ssl is loading the live certs.

Step 2. Create a script to renew the cert via an http standalone server. (Make sure it has execute permissions)

~/certbot-auto certonly\
  --standalone-supported-challenges http-01\
  --http-01-port 3005\
You can’t perform that action at this time.