Skip to content

Instantly share code, notes, and snippets.

View liuderchi's full-sized avatar
🔍
Looking for inspirations

TC Liu liuderchi

🔍
Looking for inspirations
View GitHub Profile
@liuderchi
liuderchi / tree_style_tab_firefox.md
Created March 8, 2020 15:55 — forked from ruanbekker/tree_style_tab_firefox.md
Hide Native Tabs with Tree Style Tabs for Firefox
@liuderchi
liuderchi / .graphqlconfig.yml
Last active August 18, 2019 16:52
Project config example for Graphql Playground App ( https://github.com/prisma/graphql-playground )
# For Graphql Playground
# Steps in Toolbar:
# Workspace > New Workspace > select a folder containing this file
#
# example: https://github.com/prisma/graphql-playground/pull/757/files
#
# NOTE for .env
# prepare .env with following content, in same directory as .graphqlconfig.yml
# GH_TOKEN=paste-my-github-token-here
# AIA_TOKEN_LOCAL=paste-aia-token-here
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
語法 包含 Non-Enumerable 屬性? 包含原型鍊? Note
'name' in person ✔️ ✔️ 範圍超過自己本身
Object.getOwnPropertyNames(person) ✔️ no
Object.keys(person) no no Enumerable props ONLY
for (let x in person) no ✔️ Enumerable props ONLY
@liuderchi
liuderchi / guess_num.py
Last active January 4, 2018 09:35
classical game: Guess Number for 4A0B !
import getpass
def guess_num(guess, ans):
resA, resB = 0, 0
for index, c in enumerate(guess):
findAnsRes = ans.find(c)
if findAnsRes == index:
resA += 1
elif findAnsRes >= 0 :
@liuderchi
liuderchi / iterm2-solarized.md
Created December 25, 2017 06:24 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

// sample reference https://www.npmjs.com/package/graphql-client
// GitHub API v4 reference https://developer.github.com/v4/explorer/
const graphqlClient = require('graphql-client')
// GET your token https://github.com/settings/tokens
const TOKEN = 'YOUR-TOKEN-HERE'
// choose fields of user info https://developer.github.com/v4/reference/object/user/#fields
const USERFIELDS = [
'login',
@liuderchi
liuderchi / init.js
Last active September 8, 2017 07:10
Insert React Functional Component Snippet for Atom
// steps:
// 1. copy this file to ~/.atom/init.js
// 2. in Atom, dispatch command "Window:Reload", Atom would run this file rather than init.coffee
// 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
liuderchi / index.js
Last active August 29, 2017 04:09
requirebin sketch
var R = require('ramda')
var DAY = 'DAY'
var fn = R.pipe(
function(x) {
console.log(R.equals(DAY)(x))
return x
},
R.equals(DAY),
function(x) {
@liuderchi
liuderchi / happy_git_on_osx.md
Created July 19, 2017 08:58 — forked from trey/happy_git_on_osx.md
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 user.name "Your Name"

git config --global user.email "you@example.com"