Skip to content

Instantly share code, notes, and snippets.

@tverlaan
tverlaan / ah_to_mealie.py
Created April 3, 2024 10:42
Mealie can't scrape ah.nl from docker, but it works elsewhere. This is a workaround to scrape recipes from ah.nl and call the mealie api to store them.
import requests
import uuid
from recipe_scrapers import scrape_html
MEALIE_TOKEN = ""
MEALIE_URL = ""
MEALIE_TAG_ID = ""
MEALIE_HEADERS = {"Authorization": "Bearer " + MEALIE_TOKEN}
AH_HEADERS = {"Accept-Language": "nl", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0) Gecko/20100101 Firefox/124.0"}
@tverlaan
tverlaan / min_duty_cycle_settei.sh
Created November 2, 2023 18:21 — forked from softminus/min_duty_cycle_settei.sh
Set minimum fan speed on Fujitsu/Kontron motherboards with Teutates BMC
#!/bin/bash
# Copyright (C) 2020 Kia
# Licensed under Zero Clause BSD License
if [[ $# -ne 3 ]]; then
echo "usage: $0 (BMC I2C BUS NUMBER) (FAN PAGE) (DUTY CYCLE FLOOR)"
echo ""
echo "BMC I2C BUS NUMBER can be found as follows"
@tverlaan
tverlaan / review.sh
Created July 30, 2021 20:59
Basic script to review commits you just fetched one by one
#!/bin/bash
set -e
CURRENT_VERSION="${1:-HEAD}"
NEXT_VERSION="${2:-FETCH_HEAD}"
echo "Showing commits from $NEXT_VERSION since $CURRENT_VERSION"
COMMIT_COUNT=$(git --no-pager log --format=format:%H $CURRENT_VERSION..$NEXT_VERSION | wc -l)
echo "Commits to review: $COMMIT_COUNT"
@tverlaan
tverlaan / fuzzy_doc_search.ex
Created February 2, 2020 07:13
fuzzy elixir function documentation search
iex> z foo
No function like 'foo' was found
iex> z into
Did you mean one of?
Collectable.BitString.into()
Collectable.File.Stream.into()
Collectable.HashDict.into()
Collectable.HashSet.into()
Collectable.IO.Stream.into()
Collectable.List.into()
@tverlaan
tverlaan / keybase.md
Created August 29, 2017 18:08
keybase

Keybase proof

I hereby claim:

  • I am tverlaan on github.
  • I am tverlaan (https://keybase.io/tverlaan) on keybase.
  • I have a public key whose fingerprint is EE9B 8AA4 8780 1D46 F271 69A7 E65B 0D8D 0DAF 240C

To claim this, I am signing this object:

@tverlaan
tverlaan / gist:f013c14dfdc4bc3c23459ebf51f4ca79
Created January 3, 2017 11:55 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt