Skip to content

Instantly share code, notes, and snippets.

@dustinlarimer
dustinlarimer / README.md
Last active October 8, 2015 16:45
API Read Key for NYTimes' data dump of Military Surplus Gear flowing to local police departments

Military Surplus Gear, published here

API credentials for read-access:

Project ID: 53f3eca97d8cb91b75000000

API Key (read-only): df6ff0ff414bc286b91e2661db4c691c45b6aea8d2c8cf2393169e9b9ef36a3d77e59c57b540febc8f328bf1f605782d9035c4a7072dc86c4f96ddbcce7dfe0b088ae51dd2ea36ad022290d1f3580e2d1ea202845ae7f79e7db6634ee627a26197dadf7eb2e5a46b16f04a4cae55955e

Sample dashboard here, JS source here

@spoike
spoike / reactjs_componentapi_cheatsheet.md
Created May 13, 2014 07:51
React JS Cheatsheets for Component API, Specifications and Lifecycle

ReactJS Component Cheatsheet

To create a ReactComponent:

ReactComponent React.createClass(object proto)

Basic JSX example:

var TitleComponent = React.createClass({

// REQUIRED

@clipperhouse
clipperhouse / browserProgress.js
Last active May 23, 2019 04:49
Trigger the browser's progress spinner via jQuery.
/*
One disadvantage of ajax is that the user does not see the browser’s progress UI. Typically this is
a spinner that takes the place of the favicon in the browser tab while waiting for assets to download.
I believe this to be an important piece of UI. The browser vendors think so, too, otherwise it wouldn’t
be there.
How to emulate it? By adding an element to the DOM that is waiting to download. Below, this is done
with an iframe.
@mbostock
mbostock / weekday.js
Last active November 30, 2020 09:49
Counting Weekdays
weekday = (function() {
// Returns the weekday number for the given date relative to January 1, 1970.
function weekday(date) {
var weekdays = weekdayOfYear(date),
year = date.getFullYear();
while (--year >= 1970) weekdays += weekdaysInYear(year);
return weekdays;
}

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.