Skip to content

Instantly share code, notes, and snippets.

We can't make this file beautiful and searchable because it's too large.
SEASON WEEKEND WEEK STATENAME ACTIVITY_LEVEL ACTIVITY_LEVEL_LABEL
2015-16 Jan-09-2016 1 District of Columbia Level 0 Insufficient Data
2015-16 Jan-09-2016 1 Virgin Islands Level 0 Insufficient Data
2015-16 Jan-16-2016 2 District of Columbia Level 0 Insufficient Data
2015-16 Jan-16-2016 2 Virgin Islands Level 0 Insufficient Data
2015-16 Jan-23-2016 3 District of Columbia Level 0 Insufficient Data
2015-16 Jan-23-2016 3 Virgin Islands Level 0 Insufficient Data
2015-16 Jan-30-2016 4 District of Columbia Level 0 Insufficient Data
2015-16 Jan-30-2016 4 Virgin Islands Level 0 Insufficient Data
2015-16 Feb-06-2016 5 District of Columbia Level 0 Insufficient Data
@EdwinToh
EdwinToh / ResponsiveImage.js
Created August 19, 2015 00:14
React Component to insert responsive images. Requires Picturefill.
/**
* @jsx React.DOM
*/
'use strict';
var React = require('react');
var ReactPropTypes = React.PropTypes;
var canUseDOM = require('react/lib/ExecutionEnvironment').canUseDOM;
var _ = require('underscore');
@EdwinToh
EdwinToh / Icon.js
Created August 18, 2015 18:44
React Component for SVG Icons
var React = require('react');
var Icon = React.createClass({
displayName:"Icon",
propTypes: {
icon: React.PropTypes.string.isRequired,
size: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]),
@EdwinToh
EdwinToh / horizontalMousePosScroll
Created October 27, 2013 13:23
Scroll horizontally based on mouse position. Dependencies: TweenLite - or any other scrolling library. Things to note: Put this in a function and refresh the window width variables on window resize.
var _sliderDiv = $('.galleryholder'),
_sliderInterval = null,
_mouseX = 0,
_windowWidth = $(window).width();
_sliderDiv.on('mousemove',function(e){
_mouseX = e.pageX;
});
@EdwinToh
EdwinToh / validateMobile
Created October 24, 2013 04:49
Validate Singapore phone number.
function validateMobile(mobile) {
var re1 = /\d{8}/g;
return re1.test(mobile);
}
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
function validateNRIC(nric) {
var re1 = /^(S|s)\d{7}[A-Za-z]/g;
var re2 = /^(A|M)S\d{7}[A-Z]/g;
if(re1.test(nric) || re2.test(nric)){
return true;
}
}
@EdwinToh
EdwinToh / collision.js
Created November 20, 2012 14:12
tracks whether a point is overlapping an image. note: dependency is jquery, but can easily be removed.
var image_data_cache = {};
function isPointInImage(x, y, img) {
var w = img.width;
var h = img.height;
var parentOffset = $(img).parent().offset();
x = x - parentOffset.left;