Skip to content

Instantly share code, notes, and snippets.

View alswl's full-sized avatar

Jingchao alswl

View GitHub Profile
@making
making / README.md
Last active January 5, 2024 14:06
Use lima instead of Docker Desktop on Mac

Install

brew install lima docker
limactl start default
lima sudo apt -y install docker.io
lima sudo usermod -aG docker $USER
limactl stop default
@buzztaiki
buzztaiki / swagger-ui.html
Last active November 29, 2019 04:59
Swagger UI
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css" >
<style>
html
{
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@cvan
cvan / set-up-chromium-keys.md
Last active March 19, 2024 10:44
Launch Chromium with API Keys on Mac OS X and Windows

Last Updated: March 2023

IMPORTANT: Ignore the out-of-date steps below for getting Chromium keys.

Instead, read this up-to-date guide (Jan 2023) written by @LearningToPi.

P.S. Thank you to every contributor below who provided tips over the years on what should be a straightforward process: setting up Chromium for local development.

Long live the web!

@mmrko
mmrko / git-zsh-checkout-autocomplete-local-only.md
Last active July 20, 2023 08:48
List only local branches when autocompleting git checkout (Zsh)
git config --global alias.checkoutr checkout
$EDITOR /usr/local/share/zsh/site-functions/git-completion.bash

...and then modify the file as follows...

-__gitcomp_nl "$(__git_refs '' $track)"
+if [ "$command" = "checkoutr" ]; then
+    __gitcomp_nl "$(__git_refs '' $track)"
+else
@hlissner
hlissner / codesign_gdb.md
Last active March 11, 2024 07:09
Codesign gdb on OSX
@florianbeer
florianbeer / set-tmux-title
Created April 21, 2015 10:47
Set tmux pane title to short hostname on ssh connections
ssh() {
if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then
tmux rename-window "$(echo $* | cut -d . -f 1)"
command ssh "$@"
tmux set-window-option automatic-rename "on" 1>/dev/null
else
command ssh "$@"
fi
}
@tishibas
tishibas / get_all_keys.py
Created January 12, 2015 09:00
Getting All keys in leveldb.
import leveldb
db = leveldb.LevelDB('./db')
db.Put('hello', 'value')
db.Put('world', 'value')
for k in db.RangeIter(include_value = False):
print 'K', k
This file has been truncated, but you can view the full file.
阿爸 a1'ba4 18137
阿昌族 a1'chang1'zu2 50849
阿斗 a1'dou3 42632
阿飞 a1'fei1 48603
阿富汗 a1'fu4'han4 3461
阿訇 a1'hong1 34432
阿拉伯数字 a1'la1'bo2'shu4'zi4 35937
阿拉伯语 a1'la1'bo2'yu3 30476
阿妈 a1'ma1 16220
阿门 a1'men2 47913
@dorentus
dorentus / shadowsocks-server.service
Last active April 21, 2017 15:59
wget 'https://gist.githubusercontent.com/dorentus/10704239/raw/shadowsocks-server.service' -O /etc/systemd/system/shadowsocks-server.service && systemctl enable shadowsocks-server.service && systemctl start shadowsocks-server.service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks