Skip to content

Instantly share code, notes, and snippets.

#IfWinActive Path of Exile 2
#SingleInstance force
#NoEnv
#Warn
#Persistent
FlaskDurationInit := []
FlaskDurationInit[1] := 2500
FlaskDuration := []
How to fix a corrupt zsh history file
Occasionally you may find you have a corrupt zsh history file preventing you from using the `fc` command or searching the history. Here's how to fix it.
Estimated reading time: 1 minutes
Table of contents
Corrupt ZSH history file
How to fix it
Making it a script
Corrupt ZSH history file
If you use zsh for your shell very occasionally you may find the following message appearing indicating a corrupt history file. This is normally after a reboot.
@wisnia74
wisnia74 / clone.sh
Created March 16, 2025 15:13
Clone repository using specific ssh identity
#!/bin/bash
# Check if a repository link is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <repository-link>"
exit 1
fi
# Repository link from the argument
REPO_LINK=$1
@wisnia74
wisnia74 / poe_auto_flask.ahk
Created March 14, 2025 20:33
PoE auto flask
#IfWinActive Path of Exile
#SingleInstance force
#NoEnv
#Warn
#Persistent
FlaskDurationInit := []
FlaskDurationInit[1] := 0
FlaskDurationInit[2] := 0
FlaskDurationInit[3] := 0
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@wisnia74
wisnia74 / poe_stacked_deck_opener.ahk
Last active March 14, 2025 20:30
PoE stacked deck opener
#IfWinActive Path of Exile
#SingleInstance force
#NoEnv
#Warn
#Persistent
UseStackedDeckOpener := false
!F12::
UseStackedDeckOpener := not UseStackedDeckOpener

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.