This file contains hidden or 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
| require 'uri' | |
| require 'net/http' | |
| require 'base64' | |
| require 'openssl' | |
| require 'json' | |
| class GoogGeocoder | |
| PATH = "/maps/api/geocode/json?sensor=false" |
This file contains hidden or 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 calculateDeath = function(hospital, pickupTime, travelTime) { | |
| var survivalChance = 1; | |
| // A victim’s chance of survival decreases by 7 to 10 percent / minute | |
| // that passes without defibrillation. | |
| // http://www.heart.org/idc/groups/heart-public/@wcm/@ecc/documents/downloadable/ucm_438703.pdf | |
| survivalChance -= (0.10 * pickupTime); | |
| // Time in transit to ER (.58% / minute, via the Google Directions API) | |
| // http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2464671/table/tbl1/ |
This file contains hidden or 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
| require 'sinatra' | |
| require 'sanitize' | |
| TO_REMOVE = ["", " ", " "] | |
| get '/' do | |
| <<-HTML | |
| <form method="post" action="sanitize"> | |
| <textarea name="dirty" style="width:100%;height:800px;"></textarea> | |
| <input type="submit" value="Submit"> |
This file contains hidden or 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
| # gem install crack rest-client fastercsv | |
| require 'rubygems' | |
| require 'crack' | |
| require 'rest_client' | |
| require 'fastercsv' | |
| # To use, get an access token here, by clicking "get access token" | |
| # and checking user.groups in the dialog box | |
| # https://developers.facebook.com/tools/explorer?method=GET&path=209024949216061%2Ffeed | |
| # |
This file contains hidden or 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 lookup = { | |
| "2001_v1" : 188914, | |
| "2001_v2" : 193305 | |
| } | |
| $(function() { | |
| $("#censo, #vars").change(function() { | |
| var year = $("#censo option:selected").val(); | |
| var version = $("#vars option:selected").val(); | |
| var map_id = lookup[year + "_" + version]; | |
| console.log(map_id); |
This file contains hidden or 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> | |
| <script src="http://code.jquery.com/jquery-1.8.1.min.js"></script> | |
| <script> | |
| $(document).ready(function() { | |
| $("#submit").click(function() { | |
| var username = $("#username").val(); |
This file contains hidden or 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> | |
| <style> | |
| #box { | |
| width:200px; | |
| height:200px; | |
| background:black; | |
| } | |
| #box.red { |
This file contains hidden or 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> | |
| <style> | |
| #box { | |
| width:200px; | |
| height:200px; | |
| background:black; | |
| } | |
| #box.red { |
This file contains hidden or 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> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <div id="fb-root"></div> | |
| <script src="//connect.facebook.net/en_US/all.js"></script> | |
| <script> | |
| FB.init({ |