Skip to content

Instantly share code, notes, and snippets.

View kylebradshaw's full-sized avatar
🍌

Kyle Bradshaw kylebradshaw

🍌
View GitHub Profile
@kylebradshaw
kylebradshaw / dendron-backups.md
Last active May 14, 2021 13:30
automatic dendron backups - nightly

AUTOMATIC DENDRON NIGHTLY BACKUPS

create an alias to automatically backup from cli for zsh

add an alias to .zshrc

alias dendron-nightly="cd $HOME/dendron-repo; git add .; git commit -m '$(date +%Y.%m.%d) backup'; git push origin master"

create a script to backup your dendron repo nightly

@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 / snipe.js
Last active January 13, 2017 21:11
snipe pokedex100
function snipeAlert(pokemon,iv) {
pokemon = pokemon || 'Dragonite';
iv = iv || 100;
var html = angular.element('.table-condensed').html();
var re = new RegExp(`${pokemon}<\/strong>\\n*\\s*\\t*<strong class="iv ng-binding">[${iv}]+<\/strong>`,'gi');
if(html.match(re)) {
window.alert(`Catch that ${iv}, ${pokemon}!!`);
}
}
@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
#!/bin/sh
# Kyle's Hook
######################################################################
# JSHint: Run JS formatting before committing
######################################################################
files=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$")
if [ "$files" = "" ]; then
echo "no Files"
fi
@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 / pre-commit
Created October 21, 2015 19:20
JSHint validation before git commit
#!/bin/sh
files=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$")
if [ "$files" = "" ]; then
exit 0
fi
pass=true
echo "\nValidating JavaScript:\n"