Skip to content

Instantly share code, notes, and snippets.

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

Wei Gao wgao19

👩‍🌾
👩🏻‍🌾
View GitHub Profile
@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 🙉🙈

@wgao19
wgao19 / tmux.md
Last active June 7, 2019 03:21 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer something else, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
@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 / 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 / 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 / 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 {
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 / 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.');
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;