Skip to content

Instantly share code, notes, and snippets.

View dgcoffman's full-sized avatar

Daniel Coffman dgcoffman

View GitHub Profile
{
"telemetry.telemetryLevel": "off",
"nxConsole.enableTelemetry": false,
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code",
"editor.fontSize": 16,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"workbench.editor.enablePreview": false,
"editor.renderWhitespace": "all",
@dgcoffman
dgcoffman / require-named-effect.js
Created May 23, 2022 16:16
libs/eslint-rules/require-named-effect.js
const isUseEffect = (node) => node.callee.name === 'useEffect';
const argumentIsArrowFunction = (node) => node.arguments[0].type === 'ArrowFunctionExpression';
const effectBodyIsSingleFunction = (node) => {
const { body } = node.arguments[0];
// It's a single unwrapped function call:
// `useEffect(() => theNameOfAFunction(), []);`
if (body.type === 'CallExpression') {
@dgcoffman
dgcoffman / Moving Quickly, Safely.md
Last active June 1, 2023 05:43
Moving Quickly, Safely

Don't run in place

  • Don't upgrade a dep unless you can articulate how the new version is better.
  • Don't switch tools unless you have a good reason. Because you heard the new thing was good, or because you think the current tool is bad is not a good reason. How is the old tool failing? List the ways. Steelman the argument that you should not switch.
  • Don't re-write anything unless you have a good reason. You not personally having written the old thing isn't a good reason.
  • Some framework fads are more worthy of adoption than others.
    • React.createClass -> classes -> function components -> containers -> HoCs -> render props -> hooks. Rewriting the same code through all of these changes is the full time job of a useless engineer.
    • Be judicious, wait a while and see how things work out for other people. Ideally, wait until you see the backlash after the initial hype. If you haven't seen any backlash, you might not have waited long enough to adopt.

Don't externalize your internals

@dgcoffman
dgcoffman / iOS Ecosystem.md
Last active August 2, 2023 16:48
iOS and Swift Ecosystem

✅ = we use it in coinbase-ios

Layout

  • SnapKit Swift auto layout DSL. Simplifies defining UI constraints.
  • Cartography Another declarative auto layout DSL.
  • PureLayout Extends UIView/NSView, NSArray, and NSLayoutConstraint with more Auto Layout APIs.

Dependency Injection

@dgcoffman
dgcoffman / cloudSettings
Last active October 11, 2019 19:43
Visual Studio Code Sync Settings Gist
{"lastUpload":"2019-10-11T19:43:48.295Z","extensionVersion":"v3.4.3"}
@dgcoffman
dgcoffman / proposals.txt
Created March 14, 2017 23:30
ES.Next Proposals
9th Edition - ES.Next
Stage 3 (Candidate)
===================
1. SIMD - Single Instruction Multiple Data
http://www.2ality.com/2013/12/simd-js.html
https://github.com/tc39/ecmascript_simd/blob/master/tc39/SIMD-128%20TC-39.pdf
@dgcoffman
dgcoffman / JavaScript Objects
Last active March 12, 2017 03:03
Description of how JavaScript objects work
Objects have four states:
properties can be added | deleted | modified* | do it with | check with
Default √ | √ | √ | n/a | n/a
preventExtensions X | √ | √ | preventExtensions | isExtensible
seal X | X | √ | seal | isSealed
freeze X | X | X | freeze | isFrozen
* by changing any of the four attributes below
You can make an object in three different ways:
SmashingConf New York 2016
June 14-15
New York, NY
http://lanyrd.com/2016/smashingconf-new-york/
Generate
July 15th
San Francisco, CA
http://www.generateconf.com/san-francisco-2016/

Itinerary

6:00pm Wednesday 5/25 Depart 300 Hill St

remember tickets

6:15pm Wednesday 5/25 Arrive at SFO

7:42pm Wednesday 5/25 Depart SFO for SEA

Full name Email address or phone number
Harry Potter [email protected]
Hermoine Granger [email protected]
Rupert [email protected]
Luna Lovegood
He who must not be named with a really long name 415-444-4444
Dumbledore 415-555-5555
Severus Snape 444-4244
Ron Weasley +2444-4-4-4-4
Lord voldemort 415-444-4444