Skip to content

Instantly share code, notes, and snippets.

View npdoty's full-sized avatar

Nick Doty npdoty

View GitHub Profile
@pkorac
pkorac / leafletGeoJsonTileLayer.js
Last active December 16, 2018 07:43
A really simple GeoJSON tile layer in Leaflet solution The original idea belongs to Koko A. but this is a really simple and minimal piece of code I found if you want to use tiled json layers in leaflet.js Read more about it below (in the script) and be sure that your coordinates are good in the geojson files (i.e. in the right projection).
/*
# GEOJSON TILE LAYER IN LEAFLET.JS
The original idea for this gist comes from Koko A.'s post on leaflet-js google groups
(https://groups.google.com/forum/#!msg/leaflet-js/d7ur-evSz7Q/p_B4ea_0K1AJ)
Use it at your own peril (•
## The basic concept
- setup the map and the tiles as usual
- respond to the "tileload" event with a function that loads the json file (that has the same name - z, x, y - as the tile)
@mattb
mattb / gist:4588234
Last active December 11, 2015 10:38
Count of retweets plus favourites of @BarackObama's key phrases from the 2013 US Inauguration (one asterisk = 500 retweets+favourites) as of 10:42am PST on January 21st 2013. Source code: https://gist.github.com/4588259
************************************************* Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law. (6699fav/17845rt)
************************** Our journey is not complete until our wives, our mothers, and daughters can earn a living equal to their efforts. (3059fav/9974rt)
**************** Thank you, God Bless you, and may He forever bless these United States of America. (2191fav/5866rt)
*************** Our journey is not complete until all our children know that they are cared for, and cherished, and always safe from harm. (1743fav/5970rt)
************* Our journey is not complete until we find a better way to welcome the immigrants who still see America as a land of opportunity. (1774fav/5016rt)
************ We have always understood that when times change, so must we. —President Obama (1422fav/5049rt)
************ We, the people, declare today that the most evident of truths—that all of us are created equal—is the star that guides us still. (1418fa
@ryangreenberg
ryangreenberg / gist:1199301
Created September 6, 2011 23:35
self.destruct!
#!/usr/bin/env ruby -wKU
class Object
def destruct!
print "This message will self-destruct in..."
5.downto(0) {|i| print "#{i}..."; $stdout.flush; sleep(1)}
File.open(__FILE__, 'w') { }
end
end
@romannurik
romannurik / background-page.html
Created September 24, 2009 05:15
A workaround for Cross-domain XHR's not working in Chrome Extensions' content scripts. See http://groups.google.com/group/chromium-extensions/browse_thread/thread/43ec4d383cf8d01d
<!DOCTYPE html>
<html>
<head>
<script src="xhrproxy.js"></script>
<script>
setupXHRProxy();
</script>
</head>