Skip to content

Instantly share code, notes, and snippets.

View tsaiDavid's full-sized avatar
⌨️
:imap kj <Esc>

David Tsai tsaiDavid

⌨️
:imap kj <Esc>
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tsaidavid on github.
  • I am leicaboss (https://keybase.io/leicaboss) on keybase.
  • I have a public key ASA-7RV6PqMhk3o0M1dYZiov7uuo4Y3iXwi2I8gC1KBtBAo

To claim this, I am signing this object:

@tsaiDavid
tsaiDavid / block_personal_appts
Created April 19, 2020 19:42 — forked from ttrahan/block_personal_appts
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
var secondaryEvents=secondaryCal.getEvents(today,enddate);
@tsaiDavid
tsaiDavid / ResizeSensor.js
Created April 15, 2020 18:41 — forked from STRML/ResizeSensor.js
A resize sensor component for React that doesn't use iframes, objects, or require ResizeObservers.
// @flow
import * as React from 'react';
type Dimensions = {width: number, height: number, ref: ?HTMLElement};
type Props = {
children?: React.Node,
className?: string,
onResize: (dimensions: Dimensions) => any,
};
@tsaiDavid
tsaiDavid / SketchSystems.spec
Last active November 28, 2018 19:35
Preflight
Preflight
arm -> Armed
Armed
disarm -> Preflight
takeoff -> Inflight
Inflight
En Route*
hold -> Holding
@tsaiDavid
tsaiDavid / SketchSystems.spec
Last active November 26, 2018 06:32
Pre-Takeoff
Pre-Takeoff
arm -> Armed
Armed
disarm -> Pre-Takeoff
takeoff -> Inflight
Inflight
Flying*
// Curry Function as shown in "Hardcore Functional Programming in JS"
function curry(fn) {
return function () {
// if there are fewer provided args than originally intended
if (fn.length > arguments.length) {
var slice = Array.prototype.slice
var args = slice.apply(arguments)
// return another fn that can 'delay' application of other args
return function () {
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://frontendmasters.com/assets/resources/functionaljs/v2/pointfree.browser.js"></script>
<script src="https://frontendmasters.com/assets/resources/functionaljs/v2/data.maybe.umd.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.8.0/ramda.min.js"></script>
</head>
@tsaiDavid
tsaiDavid / index.html
Last active July 7, 2018 05:52
HFP - #010 Slides
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@tsaiDavid
tsaiDavid / init.vim
Created March 29, 2018 23:42
.config/nvim/init.vim for paul
" Script to automatically load for NeoVim using `vim-plug`
" https://github.com/junegunn/vim-plug [ Paul, this is as simple vim plugin manager ]
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Specify a directory for plugins