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
license: gpl-3.0 |
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
#!/bin/bash | |
# Install required packages from Homebrew | |
brew tap homebrew/dupes | |
brew install coreutils binutils diffutils ed findutils gawk gnu-indent gnu-sed \ | |
gnu-tar gnu-which gnutls grep gzip screen watch wdiff wget bash gdb gpatch \ | |
m4 make nano file-formula git less openssh python rsync svn unzip vim \ | |
--default-names --with-default-names --with-gettext --override-system-vi \ | |
--override-system-vim --custom-system-icons | |
brew cleanup |
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
var oldDistricts = require("./old-raw.geo.json"), | |
newDistricts = require("./new-raw.geo.json"), | |
_ = require("underscore"), | |
turf = require("turf"), | |
fs = require("fs"); | |
// Clean up GeoJSON, sort districts in order | |
prep(oldDistricts); | |
prep(newDistricts); |
Old vs. new proposed North Carolina congressional districts, data via WRAL.
Polygons were pre-processed for gentler animation as follows:
- For each district, find the difference n in the number of vertices between the old and new district.
- Add n vertices to whichever one has fewer, evenly spaced along the existing polyline, so the old and new shape each have the same number of vertices (not great for performance).
- For each pair of old/new district, wind the old district around to minimize the sum of the squared distances between point index i in the old district and point index i in the new district.
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
# -*- encoding : utf-8 -*- | |
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb) | |
namespace :deploy do | |
namespace :assets do | |
desc <<-DESC | |
Run the asset precompilation rake task. You can specify the full path \ | |
to the rake executable by setting the rake variable. You can also \ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<html> | |
<head> | |
<title>Event Hub</title> | |
<script src="hub.js"></script> | |
<script> | |
var subscription = hub.subscribe('/go', function(params) { | |
console.log('one', params); | |
}); | |
var subscription2 = hub.subscribe('/go', function(params) { | |
console.log('two', params); |
Just sharing a vanilla JS tabs system i created for a personal use.
For this demo, the background is from http://www.oxygenna.com/news/free-new-set-of-material-design-backgrounds
Just sharing a vanilla JS tabs system i created for a personal use.
For this demo, the background is from http://www.oxygenna.com/news/free-new-set-of-material-design-backgrounds
NewerOlder