Skip to content

Instantly share code, notes, and snippets.

View nicohsieh's full-sized avatar

Nico Hsieh nicohsieh

  • Los Angeles, United States
View GitHub Profile
@nicohsieh
nicohsieh / .vimrc
Created August 21, 2018 23:52
my custom .vimrc setting
colorscheme gruvbox
set nocompatible
set noai
set nosi
filetype on
filetype plugin on
set laststatus=2
set backspace=indent,eol,start
syntax on
:set mouse=a
@nicohsieh
nicohsieh / Mochawesome-post-expand.md
Last active July 17, 2018 23:38
Js content to append to Mochawesome app.js asset in post-process to auto expand contexts

Procedually clicking on context items to expand them after dom mutation is over to enable auto expand behavier which Mochawesome doesn't plan to support(adamgruber/mochawesome#217)

!(function() {
 function postExpand() {
    const contextEls = document.querySelectorAll('.with-context');

    [...contextEls].forEach(item => {
      // expand test items with context
      item.querySelector('header').click();
@nicohsieh
nicohsieh / fortune-catsay-lolcat-install.md
Last active July 5, 2018 18:43
fortune | catsay | lolcat

install lolcat

gem install lolcat

install catsay

gem install catsay
@nicohsieh
nicohsieh / console_API_memo.md
Last active June 6, 2018 17:49
console API memo

Formatted log message

Use %c as a specficier to format with CSS style.

console.log(`%c${myText}`, 'color: red; background: black;');

Group log

Console groups can be nested.

  • Go to chrome://inspect

  • Click at Open dedicated DevTool for Node

  • Run node with --inspect flag: node --inpsect <file>

create database

createdb <db name>

delete datebase

dropdb <db name>

list all the databases

@nicohsieh
nicohsieh / git_command_memo.md
Last active July 25, 2019 23:34
Git command memo

Memo for some Git commands and tasks

Commands

Checkout

git checkout <commit> <file> # check out a certain verion of a file

Cherry

{
"semi": false,
"tabWidth": 2,
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"jsxBracketSameLine": false,
"parser": "babylon",
"printWidth": 120
}
0x52d244A9e58f714862f142299F430084F7F55dbA