Real-time PM2.5 monitoring results using d3 and leaflet. Work in progress but viewable here
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Rent in the US</title> | |
<style type="text/css"> | |
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,300,600'); | |
body { | |
width: 800px; |
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
// swap helper function | |
const swap = (arr, start, end) => { | |
let temp = arr[start]; | |
arr[start] = arr[end]; | |
arr[end] = temp; | |
} | |
// flip helper function using swap | |
const flip = (arr, k) => { | |
let start = 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
<!DOCTYPE html> | |
<html> | |
<meta charset="utf-8"> | |
<meta name='viewport' content="width=device-width,initial-scale=1" /> | |
<title>Earthquakes</title> | |
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/queue-async/1.0.7/queue.min.js"></script> | |
<script src="//d3js.org/topojson.v1.min.js"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>NYC Daycare Finder</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<link rel="stylesheet" href="https://d19vzq90twjlae.cloudfront.net/leaflet-0.7.3/leaflet.css" /> | |
<script src='https://api.mapbox.com/mapbox.js/v2.2.3/mapbox.js'></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.js"></script> | |
<link href='https://api.mapbox.com/mapbox.js/v2.2.3/mapbox.css' rel='stylesheet' /> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<meta name='viewport' content="width=device-width,initial-scale=1" /> | |
<title>NYC Daycare Facilities</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous"> | |
<link href='https://fonts.googleapis.com/css?family=Slackey' rel='stylesheet' type='text/css'> | |
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> |
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
const bubbleSort = arr => { | |
for (let i=arr.length-1; i>=0; i--){ | |
for(let j=1; j<=i; j++){ | |
if(arr[j-1]>arr[j]){ | |
var temp = arr[j-1]; | |
arr[j-1] = arr[j]; | |
arr[j] = temp; | |
} | |
} | |
} |
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
const cocktailSort = arr => { | |
let isSorted = true; | |
while (isSorted){ | |
for (let i=0; i< arr.length-1; i++){ | |
if (arr[i] > arr[i+1]){ | |
let temp = arr[i]; | |
arr[i] = arr[i+1]; | |
arr[i+1] = temp; | |
isSorted = true; |
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
// Challenge One | |
const arr = [{ a: 3 }, { a: 55 }, { a: 9 }, { a: 1 }]; | |
const max = (array, arg) => { | |
return array.reduce((a, b) => { | |
if(typeof arg === 'string') { | |
return a[arg] > b[arg] ? a : b; | |
} | |
else if(typeof arg === 'function') { |
NewerOlder