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
--log_gc (Log heap samples on garbage collection for the hp2ps tool.) | |
type: bool default: false | |
--expose_gc (expose gc extension) | |
type: bool default: false | |
--trace_gc (print one trace line following each garbage collection) | |
type: bool default: false | |
--trace_gc_nvp (print one detailed trace line in name=value format after each garbage collection) | |
type: bool default: false | |
--trace_gc_ignore_scavenger (do not print trace line after scavenger collection) | |
type: bool default: false |
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
const arrayEqual = (a: any[], b: any[]) => { | |
if (a.length !== b.length) return false | |
for (const index in a) | |
if (!deepEqual(a[index], b[index])) { | |
return false | |
} | |
return true |
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
const isLocalhost = Boolean( | |
window.location.hostname === 'localhost' || | |
// [::1] is the IPv6 localhost address. | |
window.location.hostname === '[::1]' || | |
// 127.0.0.1/8 is considered localhost for IPv4. | |
window.location.hostname.match( | |
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ | |
) | |
); |
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
const de = document.dispatchEvent.bind(document); | |
document.dispatchEvent = (event) => { | |
console.log(event.type) | |
return de(event) | |
} |
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 Options { | |
pattern?: Regex | |
filter(path: string)?: boolean, | |
transform(path: string, content: string)?: string, | |
onSuccess(path): void, | |
onFail(path): void, | |
} | |
const files = copyRecursive(source: string, target: string, options: Options); |
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
import {Component} from 'react'; | |
import {createPortal} from 'react-dom'; | |
const isServer = (typeof window === 'undefined'); | |
interface Props { | |
children: React.ReactNode, | |
} | |
class Portal extends React.Component<Props, never> { |
Feel free to skip steps if you already have something installed.
In your terminal:
- installing hombrew (https://brew.sh/)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Installing nodejs
brew install node
- Installing
create-react-app
npm install -g create-react-app
Right now our codebase has a bunch of Provider
components at the top level which facilitate Higher-Order-Component based dep injection. Basically we're using #3. Is this good? Is this bad? Relay modern seems to be moving to a style more like #4, and there were some positive opinions about this it seems.
Personally, I really really don't like #4 because it is type-hostile (we need to type the props that are cloned in as optional or typescript will freak out when we don't pass them) and because it just seems the least explicit to me. That said, it seems there are some other strong opinions on this.
//MyComponent.ts
import thingleton from '../../../wherever';
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
// CREATE REACT APP + CSS MODULES (replace existing style one) | |
{ | |
test: /\.css$/, | |
loader: `style!css?importLoaders=1&modules&localIdentName=[name]__[local]___[hash:base64:5]!postcss`, | |
}, | |
// SASS LOADER (put it under the css one!) | |
{ | |
test: /\.scss$/, | |
include: paths.appSrc, |