Skip to content

Instantly share code, notes, and snippets.

View coderek's full-sized avatar
👽

Derek Zeng coderek

👽
View GitHub Profile
module.exports = function (api) {
api.cache(true)
return {
plugins: [
'react-docgen',
'lodash',
'styled-components',
[
'import',
module.exports = {
'collectCoverageFrom': [
'app/**/*.{js,jsx}',
'!app/**/stories/*.{js,jsx}',
'!app/**/*.test.{js,jsx}',
'!app/*/RbGenerated*/*.{js,jsx}',
'!app/global-styles.js',
'!app/*/*/Loadable.{js,jsx}',
'!app/components/index.js',
'!app/sw/**'
set -g status-bg black
set -g status-fg white
set-option -g default-shell /usr/local/bin/bash
# Prefix is Ctrl-a
# set -g prefix C-a
# bind C-a send-prefix
# unbind C-b
set -sg escape-time 1
@coderek
coderek / init.vim
Last active February 11, 2022 09:45
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim/
let path='~/vimfiles/bundle'
call vundle#begin(path)
@coderek
coderek / react_elements.md
Last active September 22, 2020 03:20
React Components, Elements, and Instances

Element

An element is a plain object describing a component instance or DOM node and its desired properties

It contains only information about the component type (for example, a Button), its properties (for example, its color), and any child elements inside it.

An element is not an actual instance. Rather, it is a way to tell React what you want to see on the screen. You can’t call any methods on the element. It’s just an immutable description object with two fields: type: (string | ReactClass) and props: Object1.

DOM Element

@coderek
coderek / datatable-poc.html
Last active May 2, 2019 03:54
Fixed column/header with infinite scrolling - https://jsbin.com/pulakak
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>Table</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body onload="ready()">
<div id='container'></div>
@coderek
coderek / machine.js
Created January 6, 2019 07:33
An object that track the progress of a series of async actions and support stop and resume
function Machine(data, done) {
let status = 'idle'
let progress = {
success: 0,
fail: 0,
total: data.length
}
function* process(data) {
for (const rec of data) {
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim/
let path='~/vimfiles/bundle'
call vundle#begin(path)
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
set -g status-bg black
set -g status-fg white
set-option -g default-shell /usr/local/bin/bash
# Prefix is Ctrl-a
# set -g prefix C-a
# bind C-a send-prefix
# unbind C-b
set -sg escape-time 1
PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/local/sbin
export PATH
alias play="cd ~/Documents/playground"
alias projects="cd ~/Documents/projects"
alias dc="docker-compose"
alias docker_clean='docker ps -aq --no-trunc | xargs docker rm'
alias docker_clean_images='docker images -q --filter dangling=true | xargs docker rmi'
alias ll="ls -lht"