Skip to content

Instantly share code, notes, and snippets.

View jdarling's full-sized avatar

Jeremy Darling jdarling

View GitHub Profile
@jdarling
jdarling / randomcolors.js
Created June 5, 2014 20:22
Generation of complementary colors
// Adapted from http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/
var randomColor = (function(){
var golden_ratio_conjugate = 0.618033988749895;
var h = Math.random();
var hslToRgb = function (h, s, l){
var r, g, b;
if(s == 0){
@jdarling
jdarling / loader.js
Created April 7, 2015 21:52
Generic XHR (post, get, put, delete JSON requests)
/*****************************************************************************\
options
uri: {} - key value paris of data to send in url/get/uri
data: {}||'' - Object or string to be sent as JSON data in the body
for methods that support body data
dataType: '' - Data type that is being sent, by default application/json
is used. If you use anything but json|jsonp|application/json
make sure your data is already encoded properly as a string
Loader.get(uri, options, callback)
@jdarling
jdarling / gist:5624526
Last active December 17, 2015 14:29
Quick and dirty process management that we used to use. Shared for the Node.js Meetup
var _children = [];
var Beaker = function(){
};
isNumeric = function(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
};
Beaker.startChild = function(fileName, callback){
@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 / index.html
Last active May 8, 2018 12:17
Graph different parts of data in different DC charts (inbound/outbound as an example)
<!DOCTYPE html>
<html lang="en">
<head>
<title>dc.js - Dimensional Charting Javascript Library</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="https://dc-js.github.io/dc.js/css/dc.css"/>
<style>
body, html{
margin: 0;
padding: 0;
@jdarling
jdarling / index.html
Created June 10, 2014 04:27
D3 with random color generator
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.bar:hover {
fill: brown;
}
.axis {
font: 10px sans-serif;
@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: