Skip to content

Instantly share code, notes, and snippets.

@marcusti
marcusti / aoc-2023-day08.py
Last active December 8, 2023 12:08
Advent of Code 2023 Day 8: Haunted Wasteland (Python 3)
"""2023 Day 8: Haunted Wasteland"""
import itertools
import math
import re
FILENAME = "./data.txt"
MAP = dict[str, dict[str, str]]

Keybase proof

I hereby claim:

  • I am marcusti on github.
  • I am marcusti (https://keybase.io/marcusti) on keybase.
  • I have a public key ASC9qCA31sFKfvvTUBioirs5aGlm4ZzVZRL7Gddj2jO1Lgo

To claim this, I am signing this object:

@marcusti
marcusti / wuala-git.sh
Created September 9, 2012 07:49
working with a private git repo in Wuala
# create a new bare git repository
cd ~/WualaDrive/username/repos
mkdir project.git
cd project.git
git init --bare
# clone
cd ~/src
git clone ~/WualaDrive/username/repos/project.git/
cd project.git
@marcusti
marcusti / easter.py
Created August 26, 2010 19:14
easter
from datetime import date, timedelta
def calc_easter(year=date.today().year):
"""Calculating date of easter (sunday), Gauss algorithm"""
first_possible_easter = date(year, 3, 22)
a = year % 19
b = year % 4
c = year % 7
k = year / 100
p = k / 3
@marcusti
marcusti / .emacs
Created August 26, 2010 19:09
emacs config
;; === Emacs configuration file
;; === save it to ~/.emacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(case-fold-search t)
'(current-language-environment "UTF-8")
@marcusti
marcusti / gist:490801
Created July 26, 2010 16:33
python2.5 in ubuntu 10.04
# manually install python2.5, which is not in the ubuntu 10.04 repositories anymore
# zlib, ssl and sqlite3 support is needed to develop google appengine apps
sudo apt-get install build-essential zlib1g-dev libssl-dev libsqlite3-dev
wget http://www.python.org/ftp/python/2.5.5/Python-2.5.5.tgz
tar xfz Python-2.5.5.tgz
cd Python-2.5.5
# compile and install python2.5
./configure --prefix=/opt/Python2.5.5
@marcusti
marcusti / gist:98160
Created April 19, 2009 18:15
geany.snippets.conf
[Default]
block={% block %cursor% %}\n{% endblock %}
for={% for %cursor% %}\n{% endfor %}
if={% if %cursor% %}{% endif %}
with={% with %cursor% %}{% endwith %}
else={% else %}
var={{ %cursor% }}
exp={% %cursor% %}
trb={% trans %}%cursor%{% endtrans %}
tr={{ _('%cursor%') }}
@marcusti
marcusti / gist:97755
Created April 18, 2009 19:56
.bash_aliases
# ls aliases
alias ll='ls -l'
alias la='ls -lA'
alias lt='ls -lt'
alias ltr='ls -ltr'
alias l='ls -CF'
# sudo apt-get aliases
alias agi='sudo apt-get install'
alias agu='sudo apt-get update'