Skip to content

Instantly share code, notes, and snippets.

assume-paste-time 1
base-index 0
bell-action any
bell-on-alert off
default-command ""
default-shell "/usr/bin/zsh"
destroy-unattached off
detach-on-destroy on
display-panes-active-colour red
display-panes-colour blue
@JaosnHsieh
JaosnHsieh / tableRenderingExample.js
Last active November 22, 2018 09:49 — forked from markerikson/tableRenderingExample.js
React expandable table rows example ( accordion table )
class ParentComponent extends Component {
constructor() {
super();
this.state = {
data : [
{id : 1, date : "2014-04-18", total : 121.0, status : "Shipped", name : "A", points: 5, percent : 50},
{id : 2, date : "2014-04-21", total : 121.0, status : "Not Shipped", name : "B", points: 10, percent: 60},
{id : 3, date : "2014-08-09", total : 121.0, status : "Not Shipped", name : "C", points: 15, percent: 70},
{id : 4, date : "2014-04-24", total : 121.0, status : "Shipped", name : "D", points: 20, percent : 80},
@JaosnHsieh
JaosnHsieh / InstallingTmuxOnCentOS.md
Created December 3, 2018 10:27 — forked from pierreprinetti/InstallingTmuxOnCentOS.md
Installing tmux 2.3 on CentOS 7

Installing tmux 2.3 on CentOS

Prerequites

  • libevent libevent-devel libevent-headers
  • curl
# remove old pkgs
# install https://github.com/gpakosz/.tmux and beflow custom setting
# load ~/.tmux.conf
# in tmux by :source-file ~/.tmux.conf
# Or simply from a shell:
# $ tmux source-file ~/.tmux.conf
set-window-option -g mode-keys vi
bind p previous-window
bind -n C-k clear-history
@JaosnHsieh
JaosnHsieh / app.conf-http
Created December 16, 2018 12:22
next.js as frontend app, strapi as api server, nginx server config
####################
# Upstream Servers #
####################
upstream example {
server localhost:3000;
}
upstream api {
server localhost:1337;
const _ = require("lodash");
const promiseSerialBatch = (funcs, batchSize = 1) => {
if (typeof batchSize !== "number" || batchSize <= 0) {
throw Error("Error batchSize is number and bigger than 0");
}
if (batchSize === 1) {
return funcs.reduce(
(promise, func) =>
promise.then(result =>
func().then(Array.prototype.concat.bind(result))
@JaosnHsieh
JaosnHsieh / .babelrc
Created January 2, 2019 07:00
babel 6 to 7 ( @babel )
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": true
}
}
]
@JaosnHsieh
JaosnHsieh / .babelrc
Created January 2, 2019 07:09
webpack config @babel/core 7 for async await syntax and pipeline-operator
{
"presets": [
["@babel/preset-env",{
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
}
}],
"@babel/preset-react"
],
"plugins": [
@JaosnHsieh
JaosnHsieh / .vimrc
Last active January 7, 2025 01:42
vscode setting, extension list, user setting, keybinding.json, setting.json ( extension export and import from https://stackoverflow.com/a/49398449/6414615), vimrc vim setting
call pathogen#infect()
let g:ctrlp_custom_ignore = 'node_modules'
map <C-n> :NERDTreeToggle<CR>
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
" background & theme
set background=dark
colorscheme darkblue
@JaosnHsieh
JaosnHsieh / app.js
Created January 23, 2019 10:11 — forked from stongo/app.js
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});