Skip to content

Instantly share code, notes, and snippets.

View m4lvin's full-sized avatar
🤔

Malvin Gattinger m4lvin

🤔
View GitHub Profile
@rena2019
rena2019 / deutschlandticket.md
Last active April 30, 2024 07:46
DeutschlandTicket Anomalien

DeutschlandTicket Anomalien

Einige DeutschlandTickets sind anders als die anderen. Preislich soll es für 49EUR starten und für ganz Deutschland einen bestimmten Featureset mitbringen. Folgende Verkehrsverbunde wollen allerdings Zusatzoptionen anbieten:

Falls Ihr noch weitere kennt: einfach unten als Kommentar oder via Twitter ergaenzen

  • Dresdner Verkehrsbetriebe AG (DVB) @ Verkehrsverbund Oberelbe (VVO) bzw siehe PDF vom VVO
    • Deutschlandticket Plus Mitnahme (+10 EUR)
      Berechtigt zur Mitnahme im Verkehrsverbund Oberelbe (VVO) von einem Hund oder einem Fahrrad ohne zeitliche Einschränkung sowie einem weiteren Erwachsenen und bis zu vier Schülern bis zum 15. Geburtstag von Montag bis Freitag zwischen 18 und 4 Uhr sowie ganztags an Wochenenden und Feiertagen.
@anjomro
anjomro / WIFIonICE-Automatic-Login.md
Last active April 4, 2024 23:05 — forked from hacker-bastl/bahn.sh
WIFIonICE Automatic Login

WIFIonICE Automatic Login

This connector intends to automate the process of logging in into the public wifi inside of an IC /ICE of the German railways. The adapter enables does enable you to choose and keep a custom DNS server.

Usage on Linux

The script should be usable on most Linux systems, at least if the following requirements are met:

  • bash
  • ip
  • dig
@Utopiah
Utopiah / syncNC.sh
Last active February 4, 2022 14:23
# script to (one-way) synchronize a NextCloud directory to a reMarkable device
# use it manually as ssh remarkable /home/root/bin/syncNC or via Cron or systemd
#
# configure https://nextcloud.domain.tld/remote.php/dav/files/username/ with your own NextCloud Dav URL
# add your username, password and path to /opt/etc/davfs2/secrets
# install mount.davfs via opkg install davfs2
# make the required directories e.g ~/nextcloudSync2 /media/nextcloudselfhosted/ on the reMarkable
# user reMarkable2_sync/ on your NextCould or change its location here
# do a symlink between ~/xochitl-data/ and ~/.local/share/remarkable/xochitl/
@aspiwack
aspiwack / lhs2tex-mode.el
Created November 19, 2020 13:08
An Emacs configuration to colour Haskell code blocks in lhs2tex
;; I wrote a bit of Emacs configuration (which can be added to your
;; init.el) so that an lhs2tex file can be syntax-highlighted as a
;; Latex file but the Haskell code is highlighted as Haskell code. In
;; fact it's a little more than this, as the code blocks are
;; interpreted with the haskell-mode, so you can use your haskell
;; commands there.
;;
;; I don't recommend opening all `.lhs' file in this mode, as they
;; don't need to be Latex files. Literate Haskell is really agnostic
;; about its surrounding language.
#!/bin/bash
account=$1
if [[ "" == "$account" ]]; then
echo "Usage:"
echo " $(basename $0) ACCOUNT"
echo "Transfer OMEMO key from Gajim account with JID ACCOUNT to Dino"
exit 1
fi
@tzelleke
tzelleke / list_unused_references.sh
Last active May 10, 2023 14:37
Clean up your bibliography for journal submission. List unused references in bibtex bibliography
BIBTEXFILE=bibliography.bib
AUXFILE=manuscript.aux
REFS=$(mktemp -t $$_refs_XXXX) || exit 1
CITED=$(mktemp -t $$_cited_XXXX) || exit 1
egrep '^@' $BIBTEXFILE | \
sed 's/@.*{//' | \
sed 's/,$//' | \
sort >$REFS
@cobalamin
cobalamin / HaskellVsElm.md
Last active April 2, 2022 09:19
Elm (0.17) syntax and functionality differences for Haskell programmers
  • Types are declared with : and not ::, and the consing operator conversely is :: instead of :
  • No where clauses, only let/in
  • The standard style is different, check http://elm-lang.org/docs/style-guide for reference
  • Multiline strings are a thing with """
  • Haskell's data corresponds to type in Elm, and also, Haskell's type corresponds to Elm's type alias
  • ($) is (<|), but you don't use it all that much – Elm people like the flipped operator (|>) which lets you build something that reads like a pipeline
  • Related: Backticks will likely die soon in favour of functions that have an argument order that lends itself to pipelining with (|>)
  • Also, (.) is (<<), and a flipped version (>>) exists, but I don't see it used that much either
  • (&gt;&gt;=) is not an available operator and would not be polymorphic (no typeclasses, see below), and is instead commonly named SomeType.andThen – e.g. Maybe.andThen : Maybe a -&gt; (a -&gt; Maybe b) -&gt; Maybe b
@CMCDragonkai
CMCDragonkai / fold_ideas.md
Last active April 1, 2024 12:49
Haskell: Foldl vs Foldr

Foldl vs Foldr

I like to call foldr as "fold from the right", while foldl is "fold from the left".

@stoneage7
stoneage7 / VDI-shrink-trim.md
Last active February 20, 2024 21:00
Automatically shrinking VDI images under VirtualBox

Motivation

The purpose of this gist is to set up a virtual machine in such a way that the on-disk image in the host machine automatically grows and shrinks as needed by the guest machine. This utilizes the (still undocumented) "--discard" and "--nonrotational" parameters in "VBoxManage storageattach" which make the attached image appear as an SSD to the guest. Guest OS will then issue TRIM commands to the virtual controller where such an image is attached. VirtualBox is then able to capture the commands and punch holes in the attached VDIs.

Although there is some initial setup needed, I think the time saved with babysitting the VDIs is worth it. Usually you would need to zero out the free space with zerofree or sdelete and then run "VBoxManage --compact" on your images. With this setup you can allocate a large dynamic VDI (1TB or so) and it will keep itself at minimum size for easy syncing, backup, etc. You can also set it up in a template machine if you use one for clones etc.

Requirements

  • Linux
@Integralist
Integralist / Makefile
Last active January 22, 2024 00:30 — forked from isaacs/Makefile
Example of a detailed Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.