Skip to content

Instantly share code, notes, and snippets.

Looking for inspirations

TC Liu liuderchi

Block or report user

Report or block liuderchi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
liuderchi / init.js
Last active Sep 8, 2017
Insert React Functional Component Snippet for Atom
View init.js
// steps:
// 1. copy this file to ~/.atom/init.js
// 2. in Atom, dispatch command "Window:Reload", Atom would run this file rather than
// 3. create new empty file Foo.js
// 4. focus to new tab, send command "react:insert-functional-component-template"
atom.commands.add('atom-text-editor', 'react:insert-functional-component-template', () => {
editor = atom.workspace.getActiveTextEditor()
if (!editor) { return null }
const fileNameCap = getCamelCaseNameFromPath(editor.getPath())
liuderchi / index.js
Last active Aug 29, 2017
requirebin sketch
View index.js
var R = require('ramda')
var DAY = 'DAY'
var fn = R.pipe(
function(x) {
return x
function(x) {
View my-GitHub-info-graphql.js
// sample reference
// GitHub API v4 reference
const graphqlClient = require('graphql-client')
// GET your token
// choose fields of user info
const USERFIELDS = [
View python-start-learn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
liuderchi /
Created Jul 19, 2017 — forked from trey/
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global "Your Name"
git config --global ""
liuderchi / git_prompt_info.zsh
Created Jul 6, 2017 — forked from msabramo/git_prompt_info.zsh
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
View git_prompt_info.zsh
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
liuderchi /
Created Jul 5, 2017 — forked from yyx990803/
npm list only top level modules.
alias ng="npm list -g --depth=0 2>/dev/null"
alias nl="npm list --depth=0 2>/dev/null"
liuderchi / DP_stair_factorial.js
Last active Mar 23, 2017
Dynamic Programming Basic example
View DP_stair_factorial.js
function stairs(n) {
var res = [];
res[0] = 1; // first stair
res[1] = 1; // second stair
if (n > 0 && n < 2) return res[n-1];
for (var i = 2; i < n; i++){
liuderchi / check_element_visible.js
Created Dec 1, 2016
Check if element is visible in DOM
View check_element_visible.js
//Where el is the DOM element you'd like to test for visibility
function isHidden(el) {
return (el.offsetParent === null);
liuderchi /
Created Sep 23, 2016
git rename author info of commit

setup author info of past commits

  • $ git rebase -i {{base_commit|--root}}
  • edit all 'pick' to 'edit' then save
  • do following for each commit:
    • $ git commit --amend --author="Author-Name <>"
    • $ git rebase --continue

setup author info of future commits

You can’t perform that action at this time.