Skip to content

Instantly share code, notes, and snippets.

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@hippoKnight
hippoKnight / setup-ss-server.md
Last active October 12, 2019 07:58
steps to setup a shadowsocks-server on centos7 using bandwagon vps
@hippoKnight
hippoKnight / Jenkinsfile
Created May 22, 2018 03:46 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',

Capslock 换成 Ctrl

sudo vim /etc/default/keyboard
# XKBOPTIONS="ctrl:nocaps"
sudo dpkg-reconfigure keyboard-configuration
# enter enter enter
* take precedence over *
Exclude branches - a regular expression to specify branches to exclude; note that this will take precedence over includes

remote

git remote set-url origin xxxxxxx.git
git remote add <name> xxxxx.git
git remote -v

误操作将一个文件从 index 里删掉后的处理

git reset @~ 会不改变文件 但将 git HEAD 移走

--soft

vscode中vim的使用

https://feifeiyum.github.io/2017/01/23/base-vimusage/ 推荐: 关闭 vim 扩展的 useCtrlKeys, 保留一些 VS Code 自身的一些常用快捷键, 在 settings.json 里面添加配置 “vim.useCtrlKeys”: false

跳转到第n行: nG

 NEXT WORD head/end: w/e

PREVIOUS WORD HEAD: b

@hippoKnight
hippoKnight / heap_with_tree.py
Last active September 7, 2017 06:22
一个基于二叉树的大根堆, 无扩容负担, 增加和弹出为O(logN)
# -*- coding: utf-8 -*-
"""
auther = tdss
date = 17-9-7
time = 08:39
一个基于二叉树的大根堆, 无扩容负担, 增加和弹出为O(logN)
"""
import random
@hippoKnight
hippoKnight / 浏览器登录一个网页的过程.md
Last active September 4, 2017 17:06
浏览器登录一个网页的过程

stackoverflow上的一个回答https://stackoverflow.com/questions/2092527/what-happens-when-you-type-in-a-url-in-browser

In an extremely rough and simplified sketch, assuming the simplest possible HTTP request, no proxies, IPv4 and no problems in any step:

1 browser checks cache; if requested object is in cache and is fresh, skip to #9 2 browser asks OS for server's IP address 3 OS makes a DNS lookup and replies the IP address to the browser 4 browser opens a TCP connection to server (this step is much more complex with HTTPS) 5 browser sends the HTTP request through TCP connection 6 browser receives HTTP response and may close the TCP connection, or reuse it for another request