Skip to content

Instantly share code, notes, and snippets.

View jdarling's full-sized avatar

Jeremy Darling jdarling

View GitHub Profile
@jdarling
jdarling / publish.sh
Last active September 23, 2016 18:49
Generic script to publish modules to NPM. Calls npm test and npm run documentation to make sure tests pass and documentation is generated. Then increments build number, pushes to Git and publishes on NPM. Lots of command line flags.
#!/bin/bash
VERSION=`node -e "console.log(require('./package.json').version)"`
ORIG_VERSION=$VERSION
MESSAGE="Commit for version v$VERSION"
MAJOR=false
MINOR=false
PATCH=false
@jdarling
jdarling / input.cql
Last active June 1, 2017 19:10
Blank cql file
// JUST A BLANK CQL FILE
DROP KEYSPACE IF EXISTS kong;
@jdarling
jdarling / runner.js
Created April 27, 2019 13:31
Generic pattern matching and runner
const Async = require('async');
const test = `
Symptoms: #This is a comment line
Log into the kube-master switch to sudo and execute kube-master-check.sh script
Pre-checks:
N/A
Resolution:
Log into the kube-master switch to sudo and execute kube-master.sh script
@jdarling
jdarling / spec.json
Last active May 9, 2019 13:43
Trying to figure out how to highlight the proper bar and put in the tooltip based on mouse position.
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 240,
"height": 240,
"padding": 5,
"data": [
{
"name": "table",
"values": [
{
@jdarling
jdarling / keybase.md
Created July 4, 2019 20:40
keybase.md

Keybase proof

I hereby claim:

  • I am jdarling on github.
  • I am jdarling (https://keybase.io/jdarling) on keybase.
  • I have a public key ASDiF9SMuey50hYa5JJFN-glB6fZhFMTnGxwiS1aXOVH1Qo

To claim this, I am signing this object:

@jdarling
jdarling / build.sh
Created March 12, 2020 19:50
Generic build.sh script for Dockerfiles that loads and saves versioning in version.txt file in same folder as docker file.
#!/usr/bin/env bash
# Works for any Dockerfile, hardcoded service name and docker org these could be pulled from config or environment variables
SERVICE_NAME=SET_SERVICE_NAME
DOCKER_ORG=SET_DOCKER_ORG
PUBLISH=false
VERSION=false
@jdarling
jdarling / downloadimages.js
Created November 4, 2022 14:43
Download all images from a webpage
const images = Array.from(document.querySelectorAll('img'));
const imageFormat = 'png';
const imgToDataUrl = (img)=>{
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
canvas.height = img.naturalHeight;
canvas.width = img.naturalWidth;
context.drawImage(img, 0, 0);
const dataURL = canvas.toDataURL(`image/${imageFormat}`);