Skip to content

Instantly share code, notes, and snippets.

@leo-pfeiffer
leo-pfeiffer / occupancy.py
Last active February 1, 2023 21:07
St Andrews Gym Occupancy Bot
import requests
import re
import logging
import time
from datetime import datetime
# Create a custom logger
logger = logging.getLogger(__name__)
# Create handlers
@leo-pfeiffer
leo-pfeiffer / topologicalSortFinal.js
Last active July 6, 2022 22:14
Kahn's algorithm for topological sort
// Kahn's topological sort
// row number -> references
const input = [
{id: "A", refs: []},
{id: "B", refs: []},
{id: "C", refs: ["D"]},
{id: "D", refs: ["B"]},
{id: "E", refs: ["A", "B"]},
{id: "F", refs: ["A", "C"]}
@leo-pfeiffer
leo-pfeiffer / pomodoro.sh
Last active June 5, 2024 21:12
Pomodoro timer for the (Mac OS) terminal
#!/bin/bash
set -eu
# sourceable pomodoro command
pomodoro() {
# print help
echo_help() {
# Display help
echo "Pomodoro timer for the terminal."
@leo-pfeiffer
leo-pfeiffer / Programming_Languages_Extensions.json
Created April 6, 2022 21:57 — forked from ppisarczyk/Programming_Languages_Extensions.json
Programming Languages and their File Extensions
[
{
"name":"ABAP",
"type":"programming",
"extensions":[
".abap"
]
},
{
"name":"AGS Script",
{
"1C Enterprise": {
"ace_mode": "text",
"color": "#814CCC",
"extensions": [
".bsl",
".os"
],
"language_id": 0,
"tm_scope": "source.bsl",
@leo-pfeiffer
leo-pfeiffer / TryDoobie.scala
Last active March 11, 2022 09:15 — forked from isyufu/TryDoobie.scala
Doobie with SQLite
/**
lazy val doobieVersion = "1.0.0-RC1"
libraryDependencies ++= Seq(
"org.xerial" % "sqlite-jdbc" % "3.36.0.2",
"org.tpolecat" %% "doobie-core" % doobieVersion,
"org.tpolecat" %% "doobie-hikari" % doobieVersion,
"org.tpolecat" %% "doobie-scalatest" % doobieVersion % Test,
)
*/

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@leo-pfeiffer
leo-pfeiffer / adskip.js
Created February 14, 2022 14:39
YouTube Ad Skipper Script for Tampermonkey
// ==UserScript==
// @name YouTube Ad Skipper
// @namespace https://github.com/leo-pfeiffer
// @version 0.1
// @description Skip ads on youtube
// @match *://www.youtube.com/*
// ==/UserScript==
(function() {
@leo-pfeiffer
leo-pfeiffer / install_spin.sh
Last active June 20, 2024 06:50
Install Spin and iSpin on Mac
#!/bin/bash
# Install Spin and iSpin on MacOS
# adapted from https://philenius.github.io/software%20quality/2020/04/09/installing-spin-on-ubuntu-19.html
# (requires developer tools to be installed; to install them, run `xcode-select --install`)
# Install in a new directory
INSTALL_DIR=Spin
mkdir $INSTALL_DIR
cd $INSTALL_DIR
@leo-pfeiffer
leo-pfeiffer / background_processes.sh
Last active August 14, 2021 20:04
Shell script for starting multiple processes
#!/bin/bash
# first process
cd ~/Desktop/folder1
# start your first process with nohup
# (the `&` is important)
nohup python proc1.py > proc1.out 2>&1 &
echo "proc2.py PID:" $!