- cd -> zoxide
- ls -> exa
- cat -> bat
- find -> fd
- grep -> ripgrep
- diff -> diff-so-fancy
- top -> glances
- vim -> neovim
- curl -> HTTPie
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
patch: | |
punctuator/half_shape: | |
"!": {commit: "!"} | |
"\"": {pair: ["“", "”"]} | |
"#": "#" | |
"$": ["¥", "$", "€", "£", "¥", "¢", "¤"] | |
"%": ["%", "%", "°", "℃"] | |
"&": "&" | |
"(": "(" | |
")": ")" |
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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"es6": true | |
}, | |
"extends": ["airbnb-typescript", "plugin:prettier/recommended"], | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"project": "./tsconfig.json" | |
}, |
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
module.exports = { | |
parser: 'babel-eslint', | |
env: { | |
browser: true, | |
node: true, | |
commonjs: true, | |
jest: true, | |
jquery: true | |
}, | |
extends: 'airbnb-base', |
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
// Base on https://gist.github.com/kujon/2781489 | |
const clamp = (val, min, max) => { | |
const realMin = max > min ? min : max | |
const realMax = max > min ? max : min | |
return Math.max(realMin, Math.min(realMax, val)) | |
} |
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
'use strict' | |
const file = { | |
load(cb) { | |
let tmp = []; | |
d3.tsv("data.tsv", (err, list) => { | |
const length = list.length; | |
// you CANNOT overwrite tmp with another object, it must be updated with the data. | |
for(let i = 0; i < length; i++) | |
tmp[i] = list[i]; |
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
// Be sure that user input is number or number array ex: '2,4,6,1' | |
// Demo: | |
// http://jsfiddle.net/ED2Ra/6/ | |
// http://codepen.io/Knovour/pen/fFJxi | |
var keyRegex = /[\d,]$/; | |
var numberArrayReg = /^((0$|0,)|[1-9]\d*,?)*$/; // (0$|0,) : prevent 00 or 0[1-9] | |
$('input[type=text]') | |
.keypress(function(event) { |
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
var iconv = require('iconv-lite'); | |
var buf = iconv.encode('測試', 'big5'); // <buffer B4 FA B8 D5> | |
var bufLength = buf.length; | |
var test = ''; | |
for (var i = 0; i < bufLength; i++) | |
test += '%' + buf[i].toString('16').toUpperCase(); | |
// test = %B4%FA%B8%D5 |