Skip to content

Instantly share code, notes, and snippets.

View teroyks's full-sized avatar

Tero Ykspetäjä teroyks

View GitHub Profile
@teroyks
teroyks / README.md
Last active January 11, 2024 14:21
GitHub Colorize Project View

GitHub Colorization Bookmarklet and Custom Style

A bookmarklet for visualizing different card types in the GitHub project view better.

To create the bookmarklet, use a minifyer (like Minify for VS Code), or a tool like Bookmarklet builder.

Add the minified code as a bookmarklet (start with javascript:).

Alternatively, use the custom style file with e.g. Stylus. This is the preferred option if you’re able to install an extension to the browser (the bookmarklet requires activation every time but does not require installing anything).

@teroyks
teroyks / .gitignore
Last active April 25, 2023 12:03
Quarto Makefile
/.quarto/
/_book/
/.render-timestamp
@teroyks
teroyks / nitter_bookmarklet.js
Last active September 18, 2023 14:46
Redirect a Twitter URL to Nitter
javascript:(() => { const nitter_instance = 'nitter.net'; const current_url = window.location.href; window.location.href = current_url.replace(/(mobile\.)?twitter\.com/, nitter_instance); })();
@teroyks
teroyks / Activate Env.md
Last active January 20, 2022 10:43
Activate venv somewhere in the directory tree

Find and Activate venv

Tries to find and activate a virtual environment either in the current directory or the closest one in the hierarchy.

Example:

  • in /foo/bar/baz
  • first, checks if /foo/bar/baz/venv/bin/activate is found (and uses that if it is)
  • next, tries /foo/bar/venv/bin/activate
  • after that, /foo/venv/bin/activate
@teroyks
teroyks / valid_email_addresses.txt
Created December 14, 2021 16:03
Examples of valid email addresses that often trick validators
max.kaßner@bücher.de
kissa@localhost
"@"@example.com
"Joonas Koivunen"+pojat@example.com
@teroyks
teroyks / README.md
Last active November 17, 2021 09:17
Output a running count of lines

linecounter2 is an alternate version that goes to the previous line, erases it and rewrites with new info. Might be useful if you need the newline character at the end of the string (for example to flush an output buffer).

@teroyks
teroyks / pathlib.ipynb
Last active January 12, 2021 17:20
Pathlib Essentials
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@teroyks
teroyks / keybase.md
Created March 14, 2020 12:56
Keybase proof

Keybase proof

I hereby claim:

  • I am teroyks on github.
  • I am teroyks (https://keybase.io/teroyks) on keybase.
  • I have a public key ASCJsSjGzCiVzu4TCshLQwbWuCMYqmoTzxyWN5FsWozHVwo

To claim this, I am signing this object:

@teroyks
teroyks / Ad style in Google search results.md
Last active January 24, 2020 13:28
Highlight ads in Google search results

Install a user scripts extension, for example Stylish for Chrome to enable custom styles for a website.

In Stylish, install a user style:

  1. Click on the Stylish icon on the Chrome toolbar, and select Create New Style from the action menu ( ⠇).
  2. Copy the CSS style from code.cssinto the Code field.
  3. Set the Applies to method to URLs matching the regexp and copy the value from URL regex.
  4. Give a name to your custom style and save.
@teroyks
teroyks / A_closure_example.php
Last active August 8, 2019 14:39
PHP closure usage example
<?php
$myReport = new MyReport;
$myReport->report();
// 2019-08-08: MyReport started
// 2019-08-08: using logReport
// 2019-08-08: Reporting: First report
// 2019-08-08: Reporting: Second report