Skip to content

Instantly share code, notes, and snippets.

View jedwards1211's full-sized avatar

Andy Edwards jedwards1211

View GitHub Profile
@lrvick
lrvick / github-troll.md
Last active May 3, 2024 16:20
Trolling Github's DMCA repo with their own security flaws.
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active March 2, 2023 13:29
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@glenjamin
glenjamin / records.js
Last active May 4, 2020 16:50
Flow types for immutable records.
/* @flow */
import * as I from "immutable";
/**
* Define an immutable record intended for holding reducer state
* @param spec - the keys and their default values
* @return a state record factory function
*/
export function defineRecord<T: Object>(
@tsmith512
tsmith512 / ADJUSTMENTS.md
Last active May 7, 2016 00:34
Prop 1 in Austin. The diff view of ordinance 20160217-001, which is an amendment to rules governing TNC/Ridehailing applications. Use the "Revisions" tab to see the comparison.

To make the differences between the old ordinance and the new ordinance, I made a few adjustments to them to make the diff line up. Anything in red is being removed, anything in green is being added. Text in black and white is unchanged.

Renamed the DEFINITION section of the new ordinance to DEFINITIONS (plural) to match to show clearly where the real content begins. The new ordinance only has one definition.

Moved the PENALTY section from the end of the new ordenance to after DEFINITIONS to correlate to the original ordinance placement.

Renamed the TNC OPERATING AUTHORITY APPLICATION REQUIRED section of the new ordinance by removing the word "APPLICATION" to match the old ordinance.

In the IDENTITY section, replaced "app" in the new ordinance with "application" to match the old ordinance to demonstrate the similarity.

@Yaffle
Yaffle / Math.nextUp.js
Last active February 2, 2017 22:49
Math.nextAfter, Math.nextDown, Math.nextUp, Math.ulp in javascript
(function (global) {
"use strict";
// Math.nextUp
// Note:
// Math.nextDown = function (x) { return -Math.nextUp(-x); };
// Math.nextAfter = function (x, y) { return y < x ? -Math.nextUp(-x) : (y > x ? Math.nextUp(x) : (x !== x ? x : y)); };
// Math.ulp = function (x) { return x < 0 ? Math.nextUp(x) - x : x - (-Math.nextUp(-x)); };
var EPSILON = Math.pow(2, -52);