Skip to content

Instantly share code, notes, and snippets.

@aleadag
aleadag / 0arch-logo.png
Created March 11, 2025 03:57 — forked from sjsivert/0arch-logo.png
Arch Matebook installation notes
0arch-logo.png
@aleadag
aleadag / grok_vi.mdown
Created November 7, 2023 08:19 — forked from nifl/grok_vi.mdown
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@aleadag
aleadag / node_templates.sql
Last active July 25, 2023 13:07
node templates
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
INSERT INTO node_templates VALUES('2023-06-19 13:12:48.364Z','uzdmiiljz0pn7zj','messageNotifier',replace(replace('{\r\n "description": "Sends result to certain collaboration platform such as Slack or Discord",\r\n "id": "messageNotifier",\r\n "inputs": [\r\n {\r\n "description": "Message to send",\r\n "id": "in1",\r\n "name": "Message",\r\n "type": "json"\r\n }\r\n ],\r\n "name": "Message Sender",\r\n "options": [\r\n {\r\n "id": "platform",\r\n "name": "Platform",\r\n "spec": {\r\n "options": [\r\n {\r\n "id": "xiaohongshu",\r\n "name": "ๅฐ็บขไนฆ",\r\n "value": "xiaohongshu"\r\n },\r\n {\r\n "id": "slack",\r\n "name": "Slack",\r\n "data": "slack1234"\r\n },\r\n {\r\n "id": "discord",\r\n "name": "Discord",\r\n "value": "disccc"\r\n },\r\n {\r\n
@aleadag
aleadag / shell.nix
Last active March 6, 2023 17:05
Nix shell to setup Python env with requirements.txt
# https://ryantm.github.io/nixpkgs/languages-frameworks/python/#how-to-consume-python-modules-using-pip-in-a-virtual-environment-like-i-am-used-to-on-other-operating-systems
with import <nixpkgs> { };
let pythonPackages = python3Packages;
in pkgs.mkShell rec {
name = "impurePythonEnv";
venvDir = "./.venv";
buildInputs = [
# A Python interpreter including the 'venv' module is required to bootstrap
# the environment.
@aleadag
aleadag / Run shell script on gist.md
Last active January 19, 2023 15:47 — forked from mob-sakai/_README.md
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@aleadag
aleadag / README-badges.md
Created November 10, 2022 03:08 — forked from tterb/README-badges.md
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@aleadag
aleadag / gist:f60308bc3508450fc11acece290df075
Created August 19, 2022 16:22 — 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:
@aleadag
aleadag / source_env.zsh
Created May 1, 2022 16:54
Loading .env (dotenv) using bash or zsh
# https://www.cicoria.com/loading-env-dotenv-using-bash-or-zsh/
set -a; source .env; set +a
@aleadag
aleadag / npm.taobao.sh
Created April 13, 2022 16:15 — forked from lvxianchao/npm.taobao.sh
่ฎพ็ฝฎ npm ๅ’Œ yarn ็š„้•œๅƒๆบไธบๆท˜ๅฎ้•œๅƒๆบ
# ==========================================================
# NPM
# ==========================================================
npm set registry https://r.npm.taobao.org # ๆณจๅ†Œๆจกๅ—้•œๅƒ
npm set disturl https://npm.taobao.org/dist # node-gyp ็ผ–่ฏ‘ไพ่ต–็š„ node ๆบ็ ้•œๅƒ
## ไปฅไธ‹้€‰ๆ‹ฉๆทปๅŠ 
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron ไบŒ่ฟ›ๅˆถๅŒ…้•œๅƒ

Use Proxy for Git/GitHub

Generally, the Git proxy configuration depends on the Git Server Protocal you use. And there're two common protocals: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.

SSH Protocol

When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocal. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:

ProxyCommand nc -x localhost:1080 %h %p