Skip to content

Instantly share code, notes, and snippets.

View lukeggchapman's full-sized avatar

Chappo lukeggchapman

  • Sydney, Australia
View GitHub Profile
@1natsu172
1natsu172 / .eslintrc
Last active July 5, 2023 10:23
My airbnb based ESLint config for "typescript-eslint" with React & prettier
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "."
},
"env": {
"browser": true,
"jest/globals": true
},
@brunolemos
brunolemos / debounce.js
Created December 20, 2016 00:53
React Debounce Render
// usage:
// export default debounce(100)(MyComponent);
import React from 'react';
import debounce from 'lodash/debounce';
export default (interval, ...debounceArgs) => {
if (typeof interval !== 'number' && interval > 0) {
throw new Error('[debounce] Interval (ms) parameter not received.');
}
@eoghanmcilwaine
eoghanmcilwaine / getPoint.php
Created April 12, 2012 23:43
PHP function to get a point from given origin point, angle and distance
/**
* Get a point <var>dist</var> units away from <var>$cx</var>,<var>$cy</var>
* on angle <var>$ang</var>.
*
* @param {number} $cx The x coordinate of the origin point.
* @param {number} $cy The y coordinate of the origin point.
* @param {number} $ang Angle from the origin point to the returned point, in degrees.
* @param {number} $dist Unit distance from the origin point to the returned point.
* @return {array} x and y coordinates of the return point.
*/