Skip to content

Instantly share code, notes, and snippets.

View kylebradshaw's full-sized avatar
🍌

Kyle Bradshaw kylebradshaw

🍌
View GitHub Profile
@kylebradshaw
kylebradshaw / DrawSineWave.html
Created July 8, 2020 02:12 — forked from gkhays/DrawSineWave.html
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;
#!/bin/bash
# seed-storage
# ============
# Seed an existing firebase cloud storage emulator instance. Run it inside your
# project's firebase folder, ie: ./seed-storage.sh <project-name> <dest-folder>
name=firebase_export # firebase export dir name
project=$1 # project name
root=$2 # export root path
@kylebradshaw
kylebradshaw / Highcharts Cheat Sheet
Created November 28, 2016 19:40 — forked from mulhoon/Highcharts Cheat Sheet
Highcharts Cheat Sheet
$('#container').highcharts({
chart: {
alignTicks: true, // When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.
animation: true, // Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here.
backgroundColor: '#FFF', // The background color or gradient for the outer chart area.
borderColor: '#4572A7', // The color of the outer chart border.
borderRadius: 5, // The corner radius of the outer chart border. In export, the radius defaults to 0. Defaults to 5.
borderWidth: 0, // The pixel width of the outer chart border.
className: null, // A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
defaultSeriesType: 'line', // Alias of type.
@kylebradshaw
kylebradshaw / git-aliases.md
Created August 2, 2016 21:06 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@kylebradshaw
kylebradshaw / git-pre-commit-jshint-karma-unit
Created May 10, 2016 23:06 — forked from brianmriley/git-pre-commit-jshint-karma-unit
Git Pre-Commit shell script hook that executes Grunt tasks for JSHint && Karma Unit Tests before committing. Currently setup to change the directory as first step to the dir with your Gruntfile.js. Also adds PATH to grunt executable to current shell's PATH.
#!/bin/sh
#
# Pre-commit hooks
######################################################################
# Environment Setup
# 1) Change directory to build dir so we can run grunt tasks.
# 2) Make sure path is extended to include grunt task executable
# dir, as this commit shell is executed in the git
# client's own shell; ie Tower and WebStorm have own shell path.
@kylebradshaw
kylebradshaw / angular-directives.md
Last active August 29, 2015 14:26 — forked from mikesigs/angular-directive-priority.md
Angular.js directives sorted by priority
Directive Priority Terminal Creates new scope Can be used as multiElement
ngSwitch 1200 X
ngNonBindable 1000 X
ngRepeat 1000 X X X
ngIf 600 X X X
ngController 500 X
ngInit 450
ngInclude 400 X X
ngView 400 X
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@kylebradshaw
kylebradshaw / README.md
Last active August 29, 2015 14:22 — forked from kerryrodden/.block

This example shows how it is possible to use a D3 sunburst visualization (partition layout) with data that describes sequences of events.

A good use case is to summarize navigation paths through a web site, as in the sample synthetic data file (visit_sequences.csv). The visualization makes it easy to understand visits that start directly on a product page (e.g. after landing there from a search engine), compared to visits where users arrive on the site's home page and navigate from there. Where a funnel lets you understand a single pre-selected path, this allows you to see all possible paths.

Features:

  • works with data that is in a CSV format (you don't need to pre-generate a hierarchical JSON file, unless your data file is very large)
  • interactive breadcrumb trail helps to emphasize the sequence, so that it is easy for a first-time user to understand what they are seeing
  • percentages are shown explicitly, to help overcome the distortion of the data that occurs wh