Skip to content

Instantly share code, notes, and snippets.

View chrisrzhou's full-sized avatar
⌨️
clicking; clacking;

Chris Zhou chrisrzhou

⌨️
clicking; clacking;
View GitHub Profile
@chrisrzhou
chrisrzhou / patterns.js
Created August 10, 2017 17:58
Flow + React patterns
// basics
type TSimpleType = {
// prefer to name flow types with 'T*' syntax
stringProp: string,
nullableStringProp: ?string,
optionalStringProp?: string,
optionalAndNullableStringProp?: ?string,
type: 'a' | 'b' | 'c',
};
@chrisrzhou
chrisrzhou / closure.md
Last active November 14, 2016 07:12
closure and module examples in JS (from https://github.com/getify/You-Dont-Know-JS)

Closure

// no closure
for (var i=1; i<=5; i++) {
  setTimeout(() => {
    console.log(i);  // 6, 6, 6, 6, 6
  }, i*1000);
}
@chrisrzhou
chrisrzhou / interview.md
Last active November 13, 2016 04:38
swe_interview_questions

onlyOne

Write a function that returns true or false if exactly one of its parameter is true.

const a = true;
const b = false;
const c = false;
...
onlyOne(a, b, b);  // true
onlyOne(a, b, b, b); // true
@chrisrzhou
chrisrzhou / git-advanced.md
Last active August 29, 2015 14:19
Git Resources

Git Advanced Resources

Interactive Rebase

  • Enter interactive rebase using git rebase -i
  • Some rebase options include:
    • squash: combine commits
    • edit: split commits (using git reset HEAD^)
    • reword: rename commit
    • pick: run commits in order
@chrisrzhou
chrisrzhou / bootstrap.md
Last active August 29, 2015 14:19
Frontend Best Practices

Bootstrap Best Practices

General

  • Only style what you need. Create classes or IDs to allow targeting of specific elements.

Containers

  • Use container to create padding and margins that center based on screen width.
  • Use container-fluid to allow for expansion to the whole screen width while keeping a natural padding.
@chrisrzhou
chrisrzhou / README.md
Last active April 26, 2019 06:22
D3 Inflation Explorer

D3 Inflation Explorer

bl.ocks.org link

![image-inflation][]

Explores inflation by visualizing relative prices in two different years.

Mouseover to view details on relative CPI and prices. Click on a tile to freeze details. 2015 years are highlighted in gold.

The project is created using D3.js.

@chrisrzhou
chrisrzhou / README.md
Last active August 29, 2015 14:15
Dances with Factors (Tutorial)

Dances with Factors (Tutorial)

a D3 picture produced by chrisrzhou

[Interactive Project Link][]

![image-180][]


@chrisrzhou
chrisrzhou / README.md
Last active May 31, 2020 16:51
Dances with Factors

Dances with Factors

bl.ocks.org link

Dances with Factors visualizes prime factorization of integers.

The fundamental theorem of arithmetic states that every integer greater than 1 is either prime itself or a product of prime numbers.

The project is created using D3.js.


@chrisrzhou
chrisrzhou / education.md
Last active August 29, 2015 14:14
Jekyll Resume

Education

Education is a life-long journey, not a destination.


Destinations

Rice University

Bachelor of Science in Physics

  • Aug 2006 - Dec 2009