Skip to content

Instantly share code, notes, and snippets.

@arturadib
arturadib / pre-commit
Last active December 21, 2023 08:54
Pre-commit hook to prevent debug code from being committed
#
# Paste this script in your .git/hooks/pre-commit file (create one if it doesn't exist yet)
# To prevent debug code from being accidentally committed, simply add a comment near your
# debug code containing the keyword !nocommit and this script will abort the commit.
#
if git commit -v --dry-run | grep '!nocommit' >/dev/null 2>&1
then
echo "Trying to commit non-committable code."
echo "Remove the !nocommit string and try again."
@kiedtl
kiedtl / README.md
Last active July 11, 2024 13:29
[Dunnet Guide] A guide for those who struggle with the game Dunnet on Emacs. #game

Dunnet Guide

First, you start with this command in CMD / Bash--

emacs -batch -l dunnet

--and then you get this prompt.

@joyeusenoelle
joyeusenoelle / NewYearSolstice.md
Last active December 24, 2023 19:02
Why isn't the New Year on the Winter Solstice?

“Why isn’t the new year on the winter solstice?”

The answer, honestly, is that the Romans had no fucking idea how to run a calendar.

Like, seriously, people notice "OCTOber" and "DECEMber" and say, "hey, those mean 'eight' and 'ten', but they're the 10th and 12th months, what's up with that?".

If you've got a little more history, you'll know that July and August are named after Julius and Augustus Caesar, and think, "oh, they added those two months and bumped the rest of the months back."

Nope. The Romans were way, way worse at calendars than that.

@entropiae
entropiae / Install pyenv on Ubuntu 18.04 + fish shell
Last active July 7, 2024 09:46
Install pyenv on Ubuntu 18.04 + Fish shell
Install pyenv on Ubuntu 18.04 + fish shell
- Install the packages required to compile Python
$ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
- Download pyenv code from github
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
- Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned
$ echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish
@jordangarrison
jordangarrison / doom-emacs-python-black-formatter.el
Created May 28, 2020 16:53
Python Black Formatter with Emacs Doom
;; Python Black Formatter
;; package.el
(package! python-black)
;; config.el
(use-package! python-black
:demand t
:after python)
(add-hook! 'python-mode-hook #'python-black-on-save-mode)