Skip to content

Instantly share code, notes, and snippets.

View SethHamilton's full-sized avatar
💭
Married.

Seth Hamilton SethHamilton

💭
Married.
View GitHub Profile
@SethHamilton
SethHamilton / reducer.js
Last active March 19, 2018 18:56
Nice fit point reducer for mapbox
/**
* Calculate the bearing between two positions as a value from 0-360
*
* @param lat1 - The latitude of the first position
* @param lng1 - The longitude of the first position
* @param lat2 - The latitude of the second position
* @param lng2 - The longitude of the second position
*
* @return int - The bearing between 0 and 360
*/
@SethHamilton
SethHamilton / reverse_map_snippit.hpp
Last active November 21, 2017 15:53
std::unordered_map - Header only reverse map from forward map using lambda
#pragma once
#include <unordered_map>
#include <utility>
enum class test_e : int64_t
{
one,
two,
three
};
@SethHamilton
SethHamilton / paste-this.js
Last active October 8, 2015 19:28
Embedding SurveyMonkey in a Ghost Blog
<!-- this is the take survey button -->
<div id="take-my-survey" style="display:none;"><a onclick="PopSurvey();" class="smallbutton blue">Take my survey</a></div>
<!-- this is the thank-you note -->
<div id="thanks-boss" style="display:none;"><h3>Thanks for taking my survey!</h3></div>
<!-- the outer that makes up our full screen pop-up div -->
<div id="surveyOuter" style="background:#d4d4d4;z-index:999;overflow:hidden;position:fixed;display:none;top:0;left:0;right:0;bottom:0;">
<!-- a holder for our two buttons in the upper right -->
<div style="display:block;position:fixed;right:16px;top:16px;overflow:none;">
<div style="display:block;float:left;"><a onclick="HideSurvey(true);" class="smallbutton blue">Take Later</a></div>
<div style="display:block;float:left;margin-left:8px;"><a onclick="HideSurvey(false);" class="smallbutton blue">Close Survey</a></div>