# initial project
npm init
# install unit test dependencies, -D means --save-dev
npm install -D mocha chai sinon chai-http nyc
# integrate eslint & prettier & airbnb style guide
npm install -D eslint prettier
# peerdeps means to install corresponding airbnb version for eslint
npx install-peerdeps --dev eslint-config-airbnb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState, useCallback} from "react"; | |
export const AllForexPairs = [ | |
{ | |
key: "USD_JPY", | |
label: "USD/JPY", | |
}, | |
{ | |
key: "AUD_USD", | |
label: "AUD/USD", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PkgTemplates | |
t = Template(user="unclebean", license="MIT", dir="~/code", authors=["unclebean"], plugins=[TravisCI(),Codecov(),Coveralls()]) | |
generate("Project", t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove none image | |
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}") | |
// remove image with dependent child images | |
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | |
// show stopped container | |
docker ps --filter "status=exited" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java 8 | |
Lambdas | |
List<Person> people = loadPeolple(); | |
people.sort((p1, p2) -> p1.name.compareTo(p2.name)); | |
// no need final | |
public UnaryOperator<String> upperCaser(Locale locale) { | |
return str -> str.toUpperCace(locale); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set smartindent | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
# very nice vimrc configuration | |
# https://github.com/amix/vimrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:comeonin, "~> 4.0"} | |
mix deps.get | |
|> put_pass_hash() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --name postgres-jira -p 5432:5432 -e POSTGRES_PASSWORD=12345678 -v ~/atlassian/postgresql:/var/lib/postgresql/data -e POSTGRES_DB=jiradata -e POSTGRES_USER=jira -d postgres:9.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
html { | |
box-sizing: border-box; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android - unable to download js bundle | |
http://stackoverflow.com/questions/32572399/react-native-android-failed-to-load-js-bundle | |
"create an assets folder under android/app/src/main" | |
watchman issue | |
watchman shutdown-server | |
brew update && brew upgrade | |
brew uninstall --force watchman | |
brew install watchman |
NewerOlder