Skip to content

Instantly share code, notes, and snippets.

Alan Smithee GGAlanSmithee

Block or report user

Report or block GGAlanSmithee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@GGAlanSmithee
GGAlanSmithee / dealyed-redirect.ts
Last active Aug 5, 2019
react-router DelayedRedirect
View dealyed-redirect.ts
import * as React from 'react'
import { Redirect, RedirectProps } from 'react-router'
interface DelayedProps {
delay: number
}
interface DelayedState {
timeToRedirect: boolean
}
@GGAlanSmithee
GGAlanSmithee / principles.md
Last active Aug 23, 2017
Principles I like
View principles.md

Principle of least astonishment

a component of a system should behave in a manner consistent with how users of that component are likely to expect it to behave

To avoid premature optimizations

make it work, make it right, make it fast

S.O.L.I.D (for object-oriented programming)

View awesome C++.md
  • Locality matters

use arrays or vectors

  • Whole-Part Relationships and Composite Objects
    • Connected (all parts of the whole are reachable from the whole)
    • Noncircular (something can not be a part of itself (directly or indirectly)
    • Logically disjoint (an object can be shared between two other objects but if one of those objects are changed the other is not)
    • Owning (if an object is copied/deleted all its parts are copied/deleted too)
@GGAlanSmithee
GGAlanSmithee / index.md
Last active Nov 22, 2015
docker npm issues
View index.md

Sometimes npm will turn very slow out and not install anything.

It seems to have something to do with using npm on a docker VM.

The fix for me was

npm cache clean

followed by

@GGAlanSmithee
GGAlanSmithee / quotes.md
Last active Dec 14, 2017
Quotes I like
View quotes.md
@GGAlanSmithee
GGAlanSmithee / words.md
Last active Aug 23, 2017
Words I like
View words.md
  • Actionable

capable of being acted on

  • Declarative

what, not how

  • Data structure

a way of organizing data so that it can be used efficiently

A structure utilizing value, physical, and representational relationships to encode sematic relationships on a collection of objects / Sean Parent

@GGAlanSmithee
GGAlanSmithee / awesome ES(6).md
Last active Oct 13, 2015
Reminder to myself of awesome ES(6) features
View awesome ES(6).md

Reminder to myself of some nice ES(6) features

Destructuring parameters + default values

A nice way to avoid the options parameter so often used

function frob(arg1, arg2, {foo = defFoo, bar = defBar, baz = defBaz}) {
  // just use foo, bar, and baz instead of ops.foo, etc.
}
You can’t perform that action at this time.