Custom Javascript bookmarklet and CSS style definitions for customizing the experience of liiga.fi.
More about this in my blog https://hamatti.org/posts/customizing-liiga-fi-experience/.
| #!/usr/bin/env -S uv run --quiet --script | |
| # requires installation of Playwright browsers before this script is run | |
| # can be done with `pipx run playwright install` | |
| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = [ | |
| # "python-dotenv", | |
| # "playwright", | |
| # ] |
| #!/bin/zsh | |
| script=$1 | |
| scriptname=$(basename $script) | |
| echo "Making $scriptname executable..." | |
| chmod +x $script | |
| echo "Linking $scriptname to /usr/local/bin..."; | |
| ln -s "$PWD/$script" "/usr/local/bin/$scriptname" # $PWD is needed since it requires an absolute path for the link to work. |
| # Adapted from https://gist.github.com/chrisroos/92d4221c47f1396d0e76 | |
| # - added exclusion of images (in Markdown,  is an image, [title](url) is a link) | |
| # - modified from [title][url] format to [title](url) format | |
| # --no-filename cleans filenames from output when grepping from multiple sources | |
| # --only-matching=1 shows only the first capture group (in my case, the URL) | |
| pcregrep --no-filename --only-matching=1 "(?<\!\!)\[.*?\]\((.*?)\)" ~/Documents/Juhisland/003\ -\ Projects/002\ -\ Syntax\ Error/Issues/*.md | sort | uniq |
| /** | |
| * A bookmarklet to highlight teams in standings in Liiga.fi | |
| * You can use https://caiorss.github.io/bookmarklet-maker/ to turn this into a minified bookmarklet | |
| * | |
| * This works best when combined with custom CSS (I use Stylus extension for that) which hides everything | |
| * except schedule and standings. See liiga.css. | |
| */ | |
| /** | |
| * Injects our custom stylesheet into the `<head>` |
| /* Create and open extension page type of "panel" | |
| function openForm() { | |
| const createData = { | |
| type: "panel", | |
| url: "extensionPage.html", | |
| width: 250, | |
| height: 250 | |
| }; | |
| browser.windows.create(createData); | |
| } |
Custom Javascript bookmarklet and CSS style definitions for customizing the experience of liiga.fi.
More about this in my blog https://hamatti.org/posts/customizing-liiga-fi-experience/.
| const Discord = require('discord.js'); | |
| const cron = require('cron'); | |
| const client = new Discord.Client(); | |
| client.login(process.env.BOT_TOKEN); | |
| const job = new cron.CronJob("00 00 10 * * *", () => { | |
| client.channels.cache.get("[channel id]").send("Tick tock"); | |
| }); |
| class Card: | |
| def __init__(self, id, name, supertype, subtype): | |
| self.id = id | |
| self.name = name | |
| self.supertype = supertype | |
| self.subtype = subtype | |
| def play_card(card): | |
| match card: |
| class Card: | |
| def __init__(self, id, name, supertype, subtype): | |
| self.id = id | |
| self.name = name | |
| self.supertype = supertype | |
| self.subtype = subtype | |
| charizard = Card('ex3-100', 'Charizard', 'Pokemon', 'Stage 2') | |
| lapras = Card('ex3-103', 'Lapras', 'Pokemon', 'Basic') | |
| muscle_band = Card('xy1-121', 'Muscle Band', 'Trainer', 'Item') |
| // This bookmarklet is for removing the live chat from YLE Areena | |
| // Copy-paste the line below into the URL field of a new bookmark | |
| javascript:(function() { document.getElementById('yle-livefeed').remove() })() |