Skip to content

Instantly share code, notes, and snippets.

View dangeranger's full-sized avatar
🦊
🍵 🐕 🚴

Joshua Burke dangeranger

🦊
🍵 🐕 🚴
View GitHub Profile
@dangeranger
dangeranger / vtCountyPolygons.js
Created July 19, 2019 15:11
GeoJSON which represents all the county borders in Vermont.
let countyData = {"type":"FeatureCollection", "features": [
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-71.89930556685702,45.007967038225665],[-71.90639495793083,44.972034737155035],[-71.91256962807861,44.941586303684424],[-71.92014649911405,44.901534959428105],[-71.88768224564625,44.88414402607262],[-71.87785847130161,44.87877145078154],[-71.89809815971485,44.85887096608518],[-71.91995085333807,44.83690375089462],[-71.92931744591431,44.82964832537888],[-71.93683910186412,44.822541420493785],[-71.97482609720078,44.78724062557453],[-71.93929273719223,44.76945013143421],[-71.95140936345551,44.757495286499],[-71.9750836685309,44.734647555007385],[-71.99123898495328,44.71882667502445],[-71.9995389566063,44.711086418730154],[-72.01145503900082,44.698841717258844],[-72.05216258622916,44.718994083231216],[-72.08972446262909,44.73767356435365],[-72.11436109432913,44.74982120146015],[-72.11197436534691,44.74320799587801],[-72.10194093000278,44.71773911466352],[-72.08929717635908,44.68509008796579]
@dangeranger
dangeranger / index.html
Last active July 12, 2019 11:50
Code showing how to use Promises or Async/Await for making fetch requests.
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>Hello Promises!</h1>
<script>
async function getLatLongAsync(address) {
try {
// encodeURI(someString) converts the string to URL safe characters
const response = await fetch(`https://nominatim.openstreetmap.org/search/?q=${encodeURI(address)}&format=json`);
var gridOne = {
cells: [
["x", "o", "o"],
["o", "x", "o"],
["x", "x", "o"],
],
column: function(number) {
number = number - 1;
return [
this.cells[0][number],
@dangeranger
dangeranger / binary-search-algorithm-example.txt
Last active June 9, 2019 20:44
A quick example of the binary search algorithm zeroing in on a secret number.
// Example Binary Search Algorithm
// Secret Number = 17
// Guess is the midpoint of the Max and Min
// e.g. Math.floor((Max - Min) / 2) + 1
// ==============================================================
// Round-1
// Guess = 50
// Answer = 'lower'
// 1 50 100
// Min-----------------------Guess---------------------------- Max
@dangeranger
dangeranger / rbenv-linux-install.org
Last active May 31, 2019 19:14
Installation and setup of Rbenv and Ruby on Linux systems

Ruby Installation on Linux via Rbenv

Prerequisites

Make sure that you have the required build tools for Ruby.

sudo apt-get install autoconf automake bison build-essential curl \
 git-core libapr1 libaprutil1 libc6-dev libltdl-dev libreadline6  \
 libreadline6-dev libsqlite3-0 libsqlite3-dev libssl-dev libtool  \
@dangeranger
dangeranger / open-collective-schema.json
Created February 12, 2019 00:27
Open Collective GraphQL Schema
{
"_queryType": "Query",
"_mutationType": null,
"_subscriptionType": null,
"_directives": [
{
"name": "include",
"description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
"locations": [
"FIELD",
@dangeranger
dangeranger / index.html
Created October 3, 2018 15:48
BTVCA: Live demo of iterating over an HTML element collection, 2018-10-03T11-30-00-EST
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.column {
float: left;
}
.row {
clear: both;
@dangeranger
dangeranger / hackerNews.js
Created September 5, 2018 15:04
Some of the JavaScript that HackerNews uses for it's site
function $(id) { return document.getElementById(id); }
function byClass (el, cl) { return el ? el.getElementsByClassName(cl) : [] }
function byTag (el, tg) { return el ? el.getElementsByTagName(tg) : [] }
function allof (cl) { return byClass(document, cl) }
function hasClass (el, cl) { var a = el.className.split(' '); return afind(cl, a) }
function addClass (el, cl) { if (el) { var a = el.className.split(' '); if (!afind(cl, a)) { a.unshift(cl); el.className = a.join(' ')}} }
function remClass (el, cl) { if (el) { var a = el.className.split(' '); arem(a, cl); el.className = a.join(' ') } }
function html (el) { return el ? el.innerHTML : null; }
function attr (el, name) { return el.getAttribute(name) }
function tonum (x) { var n = parseFloat(x); return isNaN(n) ? null : n }

Notes from DevDocs team meeting March 30, 2018

Present:

Thibaut (GitHub: @thibaut) Alex Chafee (@alexch) Joshua Burke (?) Quincy Larson (@quincylarson)

During our 70-minute call, we talked about:

@dangeranger
dangeranger / postgres-upgrade-steps.md
Created October 14, 2017 15:00
Upgrading Postgres after brew upgrade