Skip to content

Instantly share code, notes, and snippets.

View wgao19's full-sized avatar
👩‍🌾
👩🏻‍🌾

Wei Gao wgao19

👩‍🌾
👩🏻‍🌾
View GitHub Profile

First of all, however trashy this year has been, time flies and it's 75% done.

Starting mid year this year, a very subconscious resolution started to recur, that is to pick up playing a classical string instrument again. I need to use the term string instrument because from the violin that I used to play throughout my school years, I have switched to the viola. It could be "beginners luck" but as far as the multi instruments I've been through, it feels like a string instrument of the right size for me.

As a not-so-diligent kid learning the violin, I paid zero effort into discovering anything beyond what was in front of my face. Mozart was a violin composer who composed minuet, Beethoven was a violin composer who composed a different minuet, Bach was a violin composer who composed minuet and gavotte. I'd done all the stupid things a violin 熊孩子 (Chinese slang, means an annoying kid, in particular in a not-so-smart way) would have done but I was not really ready to keep playing. Before leaving for college my

code[class*='language-'],
pre[class*='language-'] {
color: #d6deeb;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
@wgao19
wgao19 / createContext.tsx
Created November 20, 2019 03:10
tweaked [context example from react typescript cheatsheet](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet#context) for own usage
// https://github.com/typescript-cheatsheets/react-typescript-cheatsheet#context
import * as React from 'react';
function createContext<ContextType>(defaultValue?: ContextType) {
const Context = React.createContext<ContextType | undefined>(defaultValue);
const useContext = () => {
const contextValue = React.useContext(Context);
if (!contextValue)
throw new Error('`useContext` must be inside a Provider with a value.');
async function loadAuthInstance() {
const load = new Promise(function(resolve, reject) {
gapi.load('auth2', resolve);
});
return load.then(async () => {
return await window.gapi.auth2
.init({
client_id: 'client-id-apparently',
})
.then(authInstance => {
@wgao19
wgao19 / ibm-plex-suite.css
Created November 3, 2019 03:43
font loader ibm plex
/** https://fonts.googleapis.com/css?family=IBM+Plex+Mono:400,400i|IBM+Plex+Sans+Condensed:700|IBM+Plex+Sans:400,400i,700&display=swap&text=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890%E2%80%98?%E2%80%99%E2%80%9C!%E2%80%9D(%)[#]{@}/&\%3C-+%C3%B7%C3%97=%3E%C2%AE%C2%A9$%E2%82%AC%C2%A3%C2%A5%C2%A2:;,.* */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 400;
font-display: swap;
src: local('IBM Plex Mono Italic'), local('IBMPlexMono-Italic'), url(https://fonts.gstatic.com/l/font?kit=-F6pfjptAgt5VM-kVkqdyU8n1ioq131nj-onUPhF57LC54YMjPWhVoZfeuYPYxhVGisGtDFri4wiQO837A4_X48_DcqZFSrKzZnX3davc0r5EChNgAPSTyiPNK84KeOd&skey=55bf1639dd561004&v=v5) format('woff2');
}
@font-face {
@wgao19
wgao19 / parse-query.js
Created November 1, 2019 06:25
parse query
query &&
query
.split('&')
.map(item => item.split('='))
.some(([name, value]) => {
console.log('checking', name, value);
return name === 'callback' && value === '1';
})
@wgao19
wgao19 / english.md
Last active October 2, 2019 17:29
Resources on improving English (as a second language) in technical writing

Remarks

  • use thesaurus
  • use simple terms
  • use short and direct sentences, compose them only when needed, this makes sure the logic is clear and easy to follow

Tools

  • Oxford Phrasebuilder Dictionary
@wgao19
wgao19 / annotating-connected-components-with-flow.md
Last active June 24, 2019 10:28
Annotating Connected Components with Flow

Note These notes have moved here

@wgao19
wgao19 / Markdown Style Guide.md
Created April 26, 2019 02:34
To serve as an example page when styling markdown based Gatsby sites.

Markdown Style Guide

To serve as an example page when styling markdown based Gatsby sites.

Headers

Look Monkey 🙈

Look Monkey 🙉🙈