Skip to content

Instantly share code, notes, and snippets.

View LKI's full-sized avatar
🚴
Cycling Addicted

Lirian Su LKI

🚴
Cycling Addicted
View GitHub Profile
" level 0
set nocompatible
syntax on
set encoding=utf-8
set fileformat=unix
set fileformats=unix,dos
set clipboard=unnamed
let $LANG='en_US.utf8'
let mapleader='g'
nnoremap <silent> <leader>ev :e $MYVIMRC<cr>
@leeeboo
leeeboo / cluster.template.yaml
Created February 22, 2018 03:44
cn-northwest-1 kops cluster config
apiVersion: kops/v1alpha2
kind: Cluster
metadata:
name: $集群名称.k8s.local
spec:
api:
loadBalancer:
type: Public
authorization:
rbac: {}
@ram535
ram535 / gist:b1b7af6cd7769ec0481eb2eed549ea23
Last active February 2, 2023 12:25
Reuse the same terminal in neovim.
" With this function you can reuse the same terminal in neovim.
" You can toggle the terminal and also send a command to the same terminal.
let s:monkey_terminal_window = -1
let s:monkey_terminal_buffer = -1
let s:monkey_terminal_job_id = -1
function! MonkeyTerminalOpen()
" Check if buffer exists, if not create a window and a buffer
if !bufexists(s:monkey_terminal_buffer)
@hulucc
hulucc / closure.py
Created March 24, 2017 02:40
python3
def log(f):
def wrapper(*args, **kwargs):
print "f address: ", f
return f(*args, **kwargs)
return wrapper
def add(a, b):
return a + b
add = log(add)
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@ekiara
ekiara / how_to_install_tmux_on_centos
Last active August 16, 2019 13:02
HOW TO: Install tmux on Centos release 6.5
# Install tmux on Centos release 6.5
# http://superuser.com/questions/738829/attempting-to-install-tmux-on-centos-6-4-or-centos-6-5-fails-with-error-evbuff
#
# READ THIS FIRST!!!
# MAKE SURE YOU HAVE BUILD TOOLS/COMPILERS TO BUILD STUFF FROM SOURCES
# yum groupinstall "Development Tools"
# CD TO TEMPORARY DIRECTORY
@datagrok
datagrok / git-branch-simplify.md
Last active April 16, 2024 17:26
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@frsyuki
frsyuki / my_thoughts_on_msgpack.md
Created June 11, 2012 02:36
My thoughts on MessagePack

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.