Skip to content

Instantly share code, notes, and snippets.

View hunterwei's full-sized avatar

Hunter Wei hunterwei

View GitHub Profile
@hunterwei
hunterwei / vifmrc
Last active December 2, 2021 23:42
vifmrc
" vim: filetype=vifm :
" Sample configuration file for vifm (last updated: 31 August, 2021)
" You can edit this file by hand.
" The " character at the beginning of a line comments out the line.
" Blank lines are ignored.
" The basic format for each item is shown with an example.
" ------------------------------------------------------------------------------
" Command used to edit files in various contexts. The default is vim.
@hunterwei
hunterwei / surfingkeys_settings.txt
Last active October 20, 2022 18:19
Surfingkeys Settings
// Remap 'Tab on the right' with `gt`/`K`
api.map('gt', 'R');
api.map('K', 'R');
// Remap 'Tab on the left' with `gT`/`J`
api.map('gT', 'E');
api.map('J', 'E');
// Remap 'Back in hisotry' with `gT`/`J`
api.map('H', 'S');
// Remap 'Forward in hisotry' with `gT`/`J`
api.map('L', 'D');
@hunterwei
hunterwei / ideavimrc
Created February 2, 2022 16:49
IdeaVim Config file
set ideajoin
set showcmd
" integrate with system clipboard
set clipboard=unnamed,ideaput,unnamedplus
" easy tool window
nnoremap \p :action ActivateProjectToolWindow<CR>
nnoremap \c :action ActivateCommitToolWindow<CR>
nnoremap \r :action ActivateRunToolWindow<CR>
@hunterwei
hunterwei / git-checkout-all-branches.sh
Created February 18, 2022 16:29 — forked from ElfSundae/git-checkout-all-branches.sh
Git checkout all remote branches
#!/bin/bash
remote=origin ; for brname in `git branch -r | grep $remote | grep -v /master | grep -v /HEAD | awk '{gsub(/^[^\/]+\//,"",$1); print $1}'`; do git branch --track $brname $remote/$brname || true; done 2>/dev/null
@hunterwei
hunterwei / git-pushing-multiple.rst
Created February 28, 2022 21:55 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@hunterwei
hunterwei / README.md
Created March 8, 2022 05:03 — forked from binki/README.md
Hyper-V Killer WiFi network speed fix powershell commands vEthernet External

See this SO answer.

Disable large send offload in host on vEthernet (to avoid messing with non-virtual adapters). Disable larg send offload in guest for all adapters (unable to predict adapter names and probably all of them are real).

@hunterwei
hunterwei / fix-autojump-on-m1.zsh
Created March 8, 2022 17:48
Fix autojump on M1 in .zshrc
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
@hunterwei
hunterwei / github_multiple-accounts.md
Created July 4, 2022 02:44 — forked from JoaquimLey/github_multiple-accounts.md
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

@hunterwei
hunterwei / checksum_calculation.md
Created September 2, 2022 15:10 — forked from david-hoze/checksum_calculation.md
How to Calculate IP/TCP/UDP Checksum
@hunterwei
hunterwei / work-with-multiple-github-accounts.md
Created May 9, 2023 18:01 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent