Skip to content

Instantly share code, notes, and snippets.

@chrisui
chrisui / example-project.json
Created December 10, 2021 13:32
Nx Dev Processes
{
"root": "project",
"sourceRoot": "project/src",
"projectType": "application",
"targets": {
"serve": {
"executor": "..."
},
"dev": {
"executor": "my-executor-pkg:serve"
@chrisui
chrisui / keybase.md
Created August 10, 2021 11:41
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@chrisui
chrisui / owner.js
Last active September 7, 2017 18:57
Who is the OWNER of the <A /> instance here?
const A = () => <div />;
const B = ({children}) => children();
const C = () => <B>{() => <A />}</B>;
@chrisui
chrisui / 1. testComponent.js
Created March 31, 2017 18:45
Component test utility
export const testComponent = (
Component: RC,
defaultProps?
: () => Object
= () => ({}),
) => {
return (otherProps: Object, hoc?: (RC) => RC) => {
// our final props for the component merged from default
// and per-test
function Text(props) {
return <Span color="black" {...props} />
}
const BlueText = withProps({
color: 'blue'
})(Text)
@chrisui
chrisui / report.html
Created March 17, 2017 19:55
Webpack report
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webpack Bundle Analyzer</title>
<!-- viewer.js -->
<script>
@chrisui
chrisui / resources.md
Last active October 7, 2016 08:43
Lystable Frontend Learning Resources
  • "React" - Needs no introduction...
  • "React Patterns" - A nice learning resource for all the patterns you'll see used across the React ecosystem
  • “Real World Redux” - Talk I gave back in feb on our experience with Redux (there’s a recording linked on that page)
  • “Recompose” - Is a react utility library we use extensively which is allowing us to move towards writing dumber components with localised containers (ie. removing api redux as a first class api)
  • Can also see how we’re writing our own Higher order components and component enhancers here:
@chrisui
chrisui / 1. component.js
Last active September 21, 2016 13:37
Perhaps full reducer/actions are overkill for 90% of our component state needs?
export function Component({state, increment}) {
return (
<div>
{state.count} hits!
<button onClick={increment}>Hit me!</button>
</div>
);
}
@chrisui
chrisui / recon-stats.txt
Last active February 19, 2017 14:43
recon$ stats
These stats were made available from https://github.com/lystable/recon
Num modules parsed
How many modules did we explore?
1243
---
Num components
@chrisui
chrisui / stats.stdout
Last active August 25, 2016 08:22
Recon Stats Output
Num modules:
1123
Num components:
647
Most depended on components:
[ { name: 'Text', usages: 568 },
{ name: 'Button', usages: 160 },
{ name: 'Icon', usages: 127 },