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 / README.md
Last active April 2, 2024 00:02
D3 Pianogram

D3 Pianogram

bl.ocks.org link

Pianogram visualizes music notes in a beautiful histogram and updates them over music measure bars (time). This is a clone of the wonderful idea by [joeycloud][] providing real-time updates to the music over time (music measure bars).

The project is created using AngularJS and D3.js.


Code Reviews

Chris Zhou, 2022-10-14


Elements of Coding

  • Code
  • Coder
@chrisrzhou
chrisrzhou / the-garden-of-code.md
Last active June 24, 2022 20:18
Tending to your code, finding and killing bugs, growing a garden

The Garden of Code

Chris Zhou, 2022-06-24


About

I discovered many of the following thoughts through gardening and they continue to influence the way I think and code.

@chrisrzhou
chrisrzhou / README.md
Last active December 1, 2021 09:57
D3 Radar Chart

D3 Radar Chart

bl.ocks.org link

A radar chart visualizes multivariate data in a 2D chart of three or more quantitative variables represented on axes.

The project is created using AngularJS and D3.js.


Description

@chrisrzhou
chrisrzhou / code1.js
Created March 21, 2019 05:52
React Hooks + Threejs
function useResponsiveCanvas<T>(
initialSize?: MinMaxPair,
): State {
const canvasRef = useRef<HTMLCanvasElement>();
const mountRef = useRef<HTMLDivElement>();
const [size, setSize] = useState<MinMaxPair>([0, 0]);
// set initial svg and size
useEffect(() => {
const canvas = document.createElement('canvas');
@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 / typescript-notes.md
Last active February 26, 2020 00:38
Typescript notes

Main resource: https://basarat.gitbook.io/typescript/

  • Typescript is a superset of Javascript. The type system in Typescript is designed to be optional so that your Javascript is Typescript. It does not block Javascript emit in the presence of type errors, allowing users to progressively update JS to TS.
  • Upgrading to TS without anyone noticing: https://devblogs.microsoft.com/typescript/how-to-upgrade-to-typescript-without-anybody-noticing-part-1/
  • Migrating JS -> TS
    • Add a tsconfig.json.
    • Convert files from .js to .ts. Suppress errors using any.
    • Write new code in TS avoiding using any.
    • Go back to old code and start adding type annotations and fixing bugs.
  • Use ambient definitions for third party JS code.
@chrisrzhou
chrisrzhou / unified-search-spec.md
Last active February 25, 2020 19:09
Unified Search Spec
@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.