Skip to content

Instantly share code, notes, and snippets.

View albertsun's full-sized avatar

Albert Sun albertsun

View GitHub Profile
@albertsun
albertsun / sat.md
Last active August 29, 2015 13:59
If SAT questions can't interpret charts correctly, what hope do the rest of us have?

If SAT questions can't interpret charts correctly, what hope do the rest of us have?

Chart

New SAT Sample questions. Chart and story originally from The Atlantic

See anything wrong with this SAT test question?

There's no correct answer! The question writer seems to want C to be the correct answer but that's a sloppy, too fast and imprecise interpretation of the chart.

Keybase proof

I hereby claim:

  • I am albertsun on github.
  • I am albertsun (https://keybase.io/albertsun) on keybase.
  • I have a public key whose fingerprint is 9ADB 59B4 410D 33AE DC9B 21D2 E969 C37F 7850 A4AF

To claim this, I am signing this object:

@albertsun
albertsun / circle-segment.js
Created January 29, 2015 18:18
Drawing partial circles with area proportional to a value (good!) or angle proportional to a value (misleading!)
(function() {
var circleSegment = {};
var degreesToRadians = function(deg) {
return deg*Math.PI*2/360;
};
// takes an angle in radians
// returns 0-1 the proportion of a circle's area
// that a segment bounded by arc of that angle fills
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.bar {
fill: steelblue;
}
.bar:hover {
fill: brown;
javascript:(function(){for(var a=document.querySelectorAll("*"),i=0,e;e=a[i];i++)"fixed"==getComputedStyle(e).position&&(e.style.position="static");}());
@albertsun
albertsun / gist:674563
Created November 12, 2010 19:44
Parse GeoJSON for Raphael
var allPolygons = [];
function setPolys(geom) {
/* geom: a GeoJSON object.
Parse geom, and add it as a child to the global Raphael object, R.
*/
//geom.type either Polygon or MultiPolygon
var translationFunction = function(coords) {
var projected = Projections.contiguous.forward(coords);
var x = 217+(projected[0]*190/2400000);
==> Downloading http://postgis.refractions.net/download/postgis-1.5.2.tar.gz
File already downloaded in /Users/albert/Library/Caches/Homebrew
/usr/bin/tar xf /Users/albert/Library/Caches/Homebrew/postgis-1.5.2.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/postgis/1.5.2 --with-projdir=/usr/local
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/postgis/1.5.2 --with-projdir=/usr/local
configure: WARNING: unrecognized options: --disable-dependency-tracking
checking build system type... i386-apple-darwin10.7.0
checking host system type... i386-apple-darwin10.7.0
checking for gcc... /usr/bin/cc
checking whether the C compiler works... yes
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libfreenect.0.0.1.dylib
/usr/local/lib/libfreenect_sync.0.0.1.dylib
/usr/local/lib/libntfs-3g.54.0.0.dylib
/usr/local/lib/libntfs.9.0.0.dylib
@albertsun
albertsun / hackshackerspresentation.txt
Created November 1, 2011 21:14
How We Made Our Maps Links
How We Made Our Maps
http://meetupnyc.hackshackers.com/events/37680122/
Presentation Links
http://censusmapmaker.com/draw/
http://redistrictinggame.org/launchgame.php?level=basic&mission=1
http://www.publicmapping.org/
@albertsun
albertsun / vectortilemaptype.js
Created November 1, 2011 21:08
VectorTileMapType
/*
VectorTileMapType implementing the Google Maps API V3 MapType Interface
http://code.google.com/apis/maps/documentation/javascript/maptypes.html#MapTypeInterface
Used for http://censusmapmaker.com/
*/
function VectorTileMapType() {
this.minZoom = 13;
this.maxZoom = 18;
}