Skip to content

Instantly share code, notes, and snippets.

View dragonly's full-sized avatar
🎯
Focusing

Yilong Li dragonly

🎯
Focusing
View GitHub Profile
@dragonly
dragonly / gpg_key_backup.md
Created March 11, 2022 02:39 — forked from AriTheElk/gpg_key_backup.md
Backup/Restore GPG key

The following is the procedure I use on UNIX systems:

First, export all public certificates into a public keyring:

$ gpg --armor --export > pub.asc

Second, export all secret certificates into a secret keyring:

@dragonly
dragonly / Database.md
Created February 17, 2022 06:31
Papers To Read

B-Tree

  • C. Mohan, Don Handerle. ARIES: A Transaction Recovery Method Supporting Fine-Granularity Locking and Partial Rollbacks Using Write-Ahead Logging.
  • C. Mohan, Frank Levine. ARIES/lM: An Efficient and High Concurrency index Management Method Using Write-Ahead Logging.
  • Goetz Graefe. A Survey of B-Tree Logging and Recovery Techniques.
  • Goetz Graefe. A Survey of B-Tree Locking Techniques.
@dragonly
dragonly / wg0.conf on local server
Last active November 18, 2021 06:03
wireguard setup
[Interface]
PrivateKey = x
Address = 192.168.2.5/24
ListenPort = 21841
[Peer]
PublicKey = x
Endpoint = $public_ip:51820
AllowedIPs = 192.168.2.0/24
@dragonly
dragonly / gist:a0ff782d85406cf0ef2f5d74d4f4997c
Created December 4, 2020 05:38 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@dragonly
dragonly / profile.py
Created December 30, 2019 02:39
python profile
profile = cProfile.Profile()
profile.enable()
'''
code to profile
'''
profile.disable()
s = io.StringIO()
ps = pstats.Stats(profile, stream=s).sort_stats('tottime').reverse_order()
@dragonly
dragonly / tricky_chrome_debugger.html
Last active July 14, 2018 05:13
tricky chrome debugger
<html>
<body>
Just open the chrome debugger and see wierd things
<script>
let x = {
x: {
x: 1
}
}
console.log(x.x.x)
@dragonly
dragonly / vimrc
Created January 28, 2018 08:59
in addition to amix/vimrc
let g:go_version_warning = 0
let g:syntastic_check_on_wq = 0
# let g:syntastic_c_include_dirs = ["/usr/local/cuda/include"]
let g:NERDTreeWinPos = "left"
let g:NERDTreeWinSize = 20
let g:syntastic_loc_list_height = 5
set nu
set tabstop=2
set shiftwidth=2
set expandtab
@dragonly
dragonly / zshrc
Last active January 28, 2018 09:15
~/.zshrc with oh-my-zsh
export EDITOR=vim
export LC_ALL=en_US.UTF-8
export TERM=xterm-256color
# add timestamp to the right
export RPROMPT="%{$fg_bold[green]%}%D{%m-%f} %*%{$reset_color%}"
@dragonly
dragonly / pretty git log
Last active June 18, 2021 02:04
git log visualization
# put this in your ~/.gitconfig, then issue `git lg` will get you a pretty git branch topology view
#
# this is just a start point, customizations can be done by further fine tuning referencing
# https://git-scm.com/docs/git-log & https://git-scm.com/docs/pretty-formats
#
# --graph draws the git commits tree
# --date=local is used in the following --format
#
# format explanation:
# %C(colorname)xxx%C(reset) encloses text `xxx` with color `colorname`
@dragonly
dragonly / ctags_with_dep.sh
Last active July 23, 2016 11:36 — forked from xuhdev/ctags_with_dep.sh
Generate ctags file for C or C++ files and its depedencies (included header files). This could avoid you to always generate a huge tags file.
#!/bin/bash
function usage() {
echo "Usage:"
echo " ./ctags_with_dep.sh file1.c file2.cpp"
}
CFLAGS="`pkg-config --cflags ImageMagick++ freetype2 fontconfig assimp` -I../Include -IFreetypeGL -I../Common/FreetypeGL"
if [ -n "$1" ]; then