Skip to content

Instantly share code, notes, and snippets.

View unsetbit's full-sized avatar

Ozan Turgut unsetbit

View GitHub Profile
@unsetbit
unsetbit / cover2cover.py
Created September 18, 2014 21:01
Cover 2 cover
#!/usr/bin/env python
import sys
import xml.etree.ElementTree as ET
import re
import os.path
# from https://github.com/rix0rrr/cover2cover
# branch-rate="0.0" complexity="0.0" line-rate="1.0"
# branch="true" hits="1" number="86"
### Keybase proof
I hereby claim:
* I am oztu on github.
* I am ozan (https://keybase.io/ozan) on keybase.
* I have a public key whose fingerprint is D794 333E F6BB 00BC F79B 6960 80D3 CE64 5A51 F9D7
To claim this, I am signing this object:
@unsetbit
unsetbit / README.md
Last active August 29, 2015 14:01
California School Performance in 2012

California School Performance in 2012

Academic Performance Index (API) measures the academic performance of schools across a variety of measures. It's used by the California Department of Education to compare the performance of schools against each other (and themselves). 200 is the lowest score and 1000 is the highest score. 800 is the target API score for schools. This map displays disctrict-level API scores.

Scroll and drag the map to navigate.

The raw API data used in this visualization is publicly available at the CDE website. The district lines are from TIGER.

@unsetbit
unsetbit / 2012base.csv
Last active August 29, 2015 14:01
California Public School Performance (API)
We can't make this file beautiful and searchable because it's too large.
_id,School,Latitude,Longitude,API
01100170109835,FAME Public Charter,37.521612,-121.99270,771
01100170112607,Envision Academy for Arts & Technology,37.804504,-122.26812,605
01100170118489,Aspire California College Preparatory Academy,37.868993,-122.27812,790
01100170130401,Alameda County Juvenile Hall/Court,37.712904,-122.11172,415
01100170130419,Alameda County Community,37.658184,-122.09712,545
01100170130427,Alameda County Opportunity,37.658184,-122.09712,569
01316090131755,California School for the Blind,37.562594,-121.96565,523
01316170131763,California School for the Deaf-Fremont,37.558939,-121.96554,538
01611190106401,Alameda Science and Technology Institute,37.779857,-122.28053,896
@unsetbit
unsetbit / gist:5122323
Created March 9, 2013 03:14
get visible area
function getVisibleAreaHelper(container, maxBounds){
var bounds = container.getBoundingClientRect(),
visibleAreaTop = Math.max(bounds.top, maxBounds.top),
visibleAreaBottom = Math.min(bounds.bottom, maxBounds.bottom),
visibleAreaLeft = Math.max(bounds.left, maxBounds.left),
visibleAreaRight = Math.min(bounds.right, maxBounds.right);
//console.log(container, bounds.top, maxBounds.top);
@unsetbit
unsetbit / Quadtree
Created February 4, 2013 04:37
Near-infinitely scaling quadtree
/* Quadtree by Ozan Turgut (ozanturgut@gmail.com)
A Quadtree is a structure for managing many nodes interacting in space by
organizing them within a tree, where each node contains elements which may
interact with other elements within the node. This is particularly useful in
collision detection, in which a brute-force algorithm requires the checking of
every element against every other element, regardless of their distance in space.
This quadtree handles object in 2d space by their bounding boxes. It splits
a node once it exceeds the object limit per-node. When a node is split, it's
@unsetbit
unsetbit / pre-commit.
Created January 13, 2013 05:36
Pre-commit hooks for my JS projects
# Put in to .git/hooks/pre-commit
# Redirect output to stderr.
exec 1>&2
# Run unit tests
grunt test
TEST_STATUS=$?
if [ $TEST_STATUS != 0 ]; then
function getgo(container, events){
var METHOD_NAME = "getgo",
ATTRIBUTE_NAME = "data-getgo",
BROWSER_DOESNT_SUCK = typeof container.addEventListener === "function";
function createEventQueue(target){
var pending = [];
function add(event){
pending.push(event);