Skip to content

Instantly share code, notes, and snippets.

@Tomalak
Tomalak / mastodon_userstyle.css
Last active December 26, 2023 08:55
Mastodon Display Name Fix
/*
Userstyle for the the Mastodon web application
De-emphasizes the display name in favor of the
actual @username on , i.e.
┌──────────────────────────────┐
│ ┌─────┐ │
│ │ pfp │ @username@server │ larger font
│ │ │ Display Name │ smaller font
@Tomalak
Tomalak / config-highlight.cfg
Last active February 14, 2023 11:15
Configuration files for the Python IDLE editor
# .idlerc/config-highlight.cfg
# Several dark color themes
[Tomorrow Night]
definition-foreground = #81a2be
error-foreground = #e37170
normal-foreground = #c5c8c6
keyword-foreground = #b294bb
hilite-foreground = #c5c8c6
comment-background = #1d1f21
# CSV was funktioniert
import pandas as pd
df = pd.read_csv("D:\Python\Vokabeltrainer\englisch.csv",
sep=";",
header=0,
#encoding = "latin1", sollte Umlaute anpaasen, aber zerstört sie
names=["Deutsch",
"Englisch"],
dtype = {"Deutsch":str,
"Englisch":str})
@Tomalak
Tomalak / day9.py
Last active December 14, 2021 14:14 — forked from spielkind/day9.py
#!/bin/python
# https://adventofcode.com/2020/day/9
with open('day9.txt') as f:
heightmap = [list(map(int, line.strip())) for line in f]
H, W = len(heightmap), len(heightmap[0])
COORDS = [(x, y) for y in range(H) for x in range(W)]
value_at = lambda p: heightmap[p[0]][p[1]]
@Tomalak
Tomalak / day5.py
Last active December 5, 2021 17:40 — forked from spielkind/day5.py
#!/bin/python
# solution for https://adventofcode.com/2021/day/5
data = []
with open('day5.txt') as f:
for line in f:
data.append([tuple(map(int, c.split(','))) for c in line.strip().split(' -> ')])
def get_line_points(pair):
@Tomalak
Tomalak / day1.py
Last active December 2, 2021 18:12 — forked from spielkind/day1.py
#!/bin/python
with open('day1.txt') as f:
measurements = list(map(int, f))
def compare(values):
return [m for i, m in enumerate(values) if i and m > values[i-1]]
print(f"Part One: {len(compare(measurements))}")
@Tomalak
Tomalak / day2.py
Last active December 2, 2021 17:55 — forked from spielkind/day2.py
#!/bin/python
class Submarine():
def __init__(self):
self.horizontal = 0
self.depth = 0
self.aim = 0
def forward(self, amount):
self.horizontal += amount
self.depth += amount * self.aim
@Tomalak
Tomalak / machine.js
Last active July 4, 2021 14:50
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Tomalak
Tomalak / Twitter-uBlock.txt
Last active July 20, 2021 19:06
Custom blocking rules for websites I use.
! Twitter element block rules, for use in uBlock Origin -------------------------
! ads ---------------------------------------------------------------------------
twitter.com##div.suggested-tweet-stream-container
twitter.com##div.promoted-tweet
twitter.com##li.promoted-trend
twitter.com##div.Footer-adsModule
twitter.com##div.js-actionable-user.promoted-account
! timeline breakers -------------------------------------------------------------
twitter.com##.js-stream-item[data-suggestion-json*='RecycledTweetInline']
@Tomalak
Tomalak / rulesets.txt
Last active March 11, 2024 09:28
uMatrix
! uMatrix: Ruleset recipes 1.0
! Title: My various uBlock rulesets
! Maintainer: Tomalak
Vine.co Embeded Frames
* vine.co
_ vine.co image
_ vine.co css
_ vine.co script
_ vine.co frame