Skip to content

Instantly share code, notes, and snippets.

@zfz
zfz / tmux.conf
Last active August 31, 2023 20:31
setw -g mode-keys vi
# Switch panels
bind k selectp -U # switch to panel Up
bind j selectp -D # switch to panel Down
bind h selectp -L # switch to panel Left
bind l selectp -R # switch to panel Right
# History limit
set-option -g history-limit 10000
# Display 256color for Vim
set -g default-terminal "screen-256color"
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@zfz
zfz / aria2.conf
Last active March 5, 2021 23:55
aria2c scripts
#用户名
#rpc-user=user
#密码
#rpc-passwd=passwd
#上面的认证方式不建议使用,建议使用下面的token方式
#设置加密的密钥
#rpc-secret=token
#允许rpc
enable-rpc=true
#允许所有来源, web界面跨域权限需要
@zfz
zfz / diff_json.md
Last active January 12, 2021 21:49 — forked from ipan/diff-jq.md
compare two JSONs with jq #json #jq
--!connect jdbc:hive2://hadoop015.dx.momo.com:10000 ${hivevar:user} ${hivevar:passwd}
!connect jdbc:hive2://hadoop015.dx.momo.com:10000 dm dm
--beeline hive -f filename --hivevar dbname=online --hivevar partition_date=****
USE ${hivevar:dbname};
--use offline
SET mapreduce.job.queuename=data;
SET mapreduce.job.name="group_reocommend_evaluation_${hivevar:partition_date}";
@zfz
zfz / hot_group.sql
Last active November 15, 2019 16:12
CREATE TABLE IF NOT EXISTS group_hot_coeff_20141217
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' as
SELECT
group_active_member_num.group_id
,group_active_member_num.active_member_num / (group_member_num.member_num + 10)
FROM
(
SELECT
group_id AS group_id
,COUNT(*) AS active_member_num
@zfz
zfz / profile
Last active March 11, 2019 01:30
export PATH="/usr/local/bin:$PATH"
alias ll='ls -l'
alias grep='grep --color=auto'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# From: Candy Colored Terminal
# URL http://stevelosh.com/blog/2009/03/candy-colored-terminal/
@zfz
zfz / jump.py
Last active February 18, 2019 21:16
class Solution(object):
def solution(self, A):
n = len(A)
res = [n-1] # last element is counted
even = {n-1: True, None: False}
odd = {n-1: True, None: False}
def check_pos(i, flag):
if flag % 2:
if i in odd:
> const _ = require('lodash');
> obj = {'a': {'b': [1,2,3]}}
{ a: { b: [ 1, 2, 3 ] } }
> obj1 = _.cloneDeep(obj);
{ a: { b: [ 1, 2, 3 ] } }
> obj1.a.b.push(4)
# 中西文切換鍵的默認設置寫在 default.yaml 裏面
# 以下的 default.custom.yaml 在全局範圍重定義該組快速鍵
#
# 可用的按鍵有 Caps_Lock, Shift_L, Shift_R, Control_L, control_R
# Mac 系統上的鼠鬚管不能區分左、右,因此只有對 Shift_L, Control_L 的設定起作用
#
# 已輸入編碼時按切換鍵,可以進一步設定輸入法中西文切換的形式。
# 可選的臨時切換策略有三:
# inline_ascii 在輸入法的臨時西文編輯區內輸入字母、數字、符號、空格等,回車上屏後自動復位到中文
# commit_text 已輸入的候選文字上屏並切換至西文輸入模式