Skip to content

Instantly share code, notes, and snippets.

View brightrain's full-sized avatar

David Puckett brightrain

View GitHub Profile
@brightrain
brightrain / camp-ahead.js
Last active August 29, 2015 14:15
define campground engine
// https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md#options
var campBH = new Bloodhound({
name: "camp",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
// feature services currently only support query
@brightrain
brightrain / so-blinky.html
Last active August 29, 2015 13:58
so blinky
<span id='so-blinky' style='text-decoration: blink;'>i m so blinky</span>
@brightrain
brightrain / togglability.js
Last active August 29, 2015 13:58
click event for toggling map layer
//click event for layers
//using dojo for the event and class toggling
//but could just as easily be jQuery or vanilla javascript
on(dojo.byId("trail"), "click", function() {
trailsLayer.visible ? trailsLayer.hide() : trailsLayer.show();
dojo.toggleClass(this, "visible");
dojo.query("#trail .visibility-icon")
.toggleClass("fa-picture-o")
.toggleClass("fa-ban");
});
@brightrain
brightrain / togglable-layers-style.css
Last active August 29, 2015 13:58
togglable layers
.togglable-layer {
margin-top: 0.8em;
width: 100%;
}
.togglable-layer:hover {
background-color: #ccc;
cursor: pointer;
}
.togglable-layer.visible {
background-color: white;
@brightrain
brightrain / mlbparks.geojson
Created March 13, 2014 18:13
MLB Baseball Stadiums
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brightrain
brightrain / fortCollinsNhoods.geojson
Created March 12, 2014 19:01
City of Fort Collins Colorado Neighborhoods
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!--grab it-->
<script src="js/geoutils.js" type="text/javascript"></script>
<script src="js/geoutils.js" type="text/javascript"></script>
@brightrain
brightrain / map.geojson
Created August 14, 2013 19:55
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brightrain
brightrain / index.html
Created August 7, 2013 19:54
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;