This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Azimuth { | |
constructor() { | |
this.watchId = null; | |
this.latitude = null; | |
this.longitude = null; | |
this.latLon = (lat, lon) => { | |
this.latitude = lat; | |
this.longitude = lon; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TERM=xterm-256color | |
# If you come from bash you might have to change your $PATH. | |
export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/pbontrag/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g default-terminal "screen-256color" | |
# remap prefix to Control + a | |
set -g prefix C-a | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
set-option -g default-shell /usr/local/bin/zsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set t_Co=256 | |
set termguicolors | |
set nocompatible" be iMproved, required | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'mattn/emmet-vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert from degrees to radians. | |
Math.radians = function(degrees) { | |
return degrees * Math.PI / 180; | |
} | |
Math.radians(90); // 1.5707963267948966 | |
// Convert from radians to degrees. | |
Math.degrees = function(radians) { | |
return radians * 180 / Math.PI; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* * / | |
Due to target constraints, it had to be done with jQuery (no new hotness allowed). | |
It took me some time to figure this out so, I thought I'd store it here for reference. | |
/* */ | |
var doSomeDeferredStuff = function doSomeDeferredStuff(dvcs) { | |
console.log('in doSomeDeferredStuff'); | |
var deferreds = []; | |
$.each(dvcs, function(i, dvc) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loadScript = src => { | |
return new Promise((resolve, reject) => { | |
const script = document.createElement('script'); | |
script.async = true; | |
script.src = src; | |
script.onload = resolve; | |
script.onerror = reject; | |
document.body.appendChild(script); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.different = function(str2) { | |
const arr1 = this.split(/\W/); | |
const arr2 = str2.split(/\W/); | |
return arr1.diff(arr2).join(' '); | |
}; | |
// requires this as well | |
// https://gist.github.com/mattbontrager/7500cc5696ff4efe249f2ac0adbeb8ec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.same = function(str2) { | |
const arr1 = this.split(/\W/); | |
const arr2 = str2.split(/\W/); | |
return arr1.inCommon(arr2).join(' '); | |
}; | |
// requires use of this | |
// https://gist.github.com/mattbontrager/2a9b71c7110ab61f9ef948208646c85f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.diff = function(arr2) { | |
let arr1 = this; | |
let diff = new Set(); | |
arr1.forEach(item => !arr2.includes(item) && diff.add(item)); | |
arr2.forEach(item => !arr1.includes(item) && diff.add(item)); | |
return Array.from(diff); | |
}; |
NewerOlder