Skip to content

Useful code snippets and scripts

Don't F&_k with Paste
// Prevents websites from blocking copy/paste
var allowPaste = function(e){
  e.stopImmediatePropagation();
  return true;
};
document.addEventListener('paste', allowPaste, true);
Get the current IPv4 address
curl -s https://api.ipify.org
Get the current IPv6 address
curl -s https://api6.ipify.org
List the available versions of a PyPi package
curl -s https://pypi.org/pypi/<package>/json | jq '.releases | keys | .[]'

Git

Sign all commits from the commit id
git rebase --exec 'git commit --amend --no-edit -n -S' -i <commit id>
Resign all commits in a repository
git rebase --exec 'git commit --amend --no-edit --no-verify -S' -i --root
Keep the commited date when signing using above commands
git rebase --committer-date-is-author-date -i --root