Skip to content

Instantly share code, notes, and snippets.

View styfle's full-sized avatar

Steven styfle

View GitHub Profile
@styfle
styfle / newsapi.json
Created August 25, 2017 18:03
newsapi.json
{
"status": "ok",
"source": "the-new-york-times",
"sortBy": "top",
"articles": [{
"author": "Michael M. Grynbaum",
"title": "Wall Street Journal Editor Admonishes Reporters Over Trump Coverage",
"description": "In internal emails, Gerard Baker described the draft of an article about the president’s rally in Phoenix as “commentary dressed up as news reporting.”",
"url": "https://www.nytimes.com/2017/08/23/business/media/wall-street-journal-editor-admonishes-reporters-over-trump-coverage.html",
"urlToImage": "https://static01.nyt.com/images/2017/08/24/business/24wsj1/24wsj1-facebookJumbo.jpg",
@styfle
styfle / keybase.md
Created October 5, 2017 16:01
Proof that I am the real styfle!

Keybase proof

I hereby claim:

  • I am styfle on github.
  • I am styfle (https://keybase.io/styfle) on keybase.
  • I have a public key ASBNLU4Ir9YfbXm5mKOxx4PCrpCIUJ75lbl40R4oyZNkUwo

To claim this, I am signing this object:

@styfle
styfle / 41705559.ts
Created November 17, 2017 15:04
TypeScript SO question 41705559
type Opt = { id: string, name: string }
interface MultiProps {
isMultiple: true;
options: Opt[];
id: string[];
onChange: (id: string[]) => void;
}
interface SingleProps {
@styfle
styfle / 49156502.ts
Created March 7, 2018 17:55
Answer to stackoverflow question 49156502
function isDate(obj: any): obj is Date {
return typeof obj === 'object' && 'toISOString' in obj;
}
function isString(obj: any): obj is string {
return typeof obj === 'string';
}
interface JWT {
id: string;
@styfle
styfle / simpsons-characters.md
Created April 10, 2018 15:49
An alphabetical list of characters from The Simpsons

Simpsons Characters

An alphabetical list of characters from The Simpsons

  • Apu Nahasapeemapetilon
  • Bart Simpson
  • Carl Carlson
  • Duffman
  • Edna Krabappel
  • Fat Tony
@styfle
styfle / InputNumber.tsx
Last active April 17, 2018 17:01
InputNumber.tsx example for componentWillReceiveProps
interface Props {
value: number;
onChange: (value: number) => void;
widthPx?: number;
inline?: boolean;
disabled?: boolean;
}
interface State {
valueAsString: string;