This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export enum FAIconName { | |
glass, | |
music, | |
search, | |
envelopeAlt, | |
heart, | |
star, | |
starEmpty, | |
user, | |
film, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toInt(str: string): { valid: boolean, int?: number } { | |
const int = parseInt(str); | |
if (isNaN(int)) { | |
return { valid: false }; | |
} | |
else { | |
return { valid: true, int }; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toInt(str:string){ | |
return str ? parseInt(str) : undefined; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Foo { | |
a: number; | |
b?: number; | |
} | |
var foo: Foo = { | |
a: 123 | |
}; // Don't set `b` to anything. |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14007 verbose request using bearer token for auth | |
14008 verbose etag "9UYOOOWNVI5L8X8INS4P8Z6ZP" | |
14009 http request GET https://registry.npmjs.org/object-keys | |
14010 http 304 https://registry.npmjs.org/object-keys | |
14011 verbose headers { 'cache-control': 'max-age=300', | |
14011 verbose headers 'accept-ranges': 'bytes', | |
14011 verbose headers date: 'Sun, 21 Feb 2016 02:45:21 GMT', | |
14011 verbose headers via: '1.1 varnish', | |
14011 verbose headers connection: 'keep-alive', | |
14011 verbose headers 'x-served-by': 'cache-mel6521-MEL', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SelfFocusingInput extends React.Component<{ value: string, onChange: (value: string) => any }, {}>{ | |
ctrls: { | |
input?: HTMLInputElement; | |
} = {}; | |
render() { | |
return ( | |
<input | |
ref={(input) => this.ctrls.input = input} | |
value={this.props.value} | |
onChange={(e) => { this.props.onChange(this.ctrls.input.value) } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* For `number` we assume pixels e.g. 5 => '5px' | |
* For `string` you should provide the unit e.g. '5px' | |
*/ | |
type BoxUnit = number | string; | |
function boxUnitToString(value: BoxUnit): string { | |
if (typeof value === 'number') { | |
return value.toString() + 'px'; | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type PaddingUnit = number | string; | |
export function padding(all: PaddingUnit); | |
export function padding(topAndBottom: PaddingUnit, leftAndRight: PaddingUnit); | |
export function padding(top: PaddingUnit, right: PaddingUnit, bottom: PaddingUnit, left: PaddingUnit); | |
export function padding(a: PaddingUnit, b?: PaddingUnit, c?: PaddingUnit, d?: PaddingUnit) { | |
if (!b && !c && !d) { | |
b = c = d = a; | |
} | |
else if (!c && !d) { | |
c = a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type PaddingUnit = number | string; | |
export function padding(a: PaddingUnit, b?: PaddingUnit, c?: PaddingUnit, d?: PaddingUnit) { | |
if (!b && !c && !d) { | |
b = c = d = a; | |
} | |
else if (!c && !d) { | |
c = a; | |
d = b; | |
} | |
return { |