Skip to content

Instantly share code, notes, and snippets.

@szupie
szupie / screenshotter.sh
Last active April 17, 2024 22:32
Bash script to save full-page screenshots of a list of URLs, using Firefox in headless mode
#!/bin/bash
# Script to save full-page screenshots of a list of URLs, using Firefox in headless mode
# Run with path to file containing list of URLs as first argument:
# sh ./path/to/screenshotter.sh ./path/to/urls.txt
# Screenshots will be saved to a folder named the specified width
@szupie
szupie / tab-focus-results.user.js
Last active October 18, 2022 21:30
UserScript to enable use of tab key to navigate through Google search results. Also available as extension: https://github.com/szupie/tab-focus-google
// ==UserScript==
// @name Tab Focus through Google Search Results
// @description Use the tab key to navigate through Google and DuckDuckGo search results
// @version 1.1.3
// @match *://*/search*
// @include *://*.google.*/search*
// @match *://*.duckduckgo.com/*
// @grant none
// @author szupie szupie@gmail.com
// @namespace szupie
@szupie
szupie / frecency-foobar2000
Created August 19, 2021 05:06
Frecency score dynamic field config for foobar2000
// Low score indicate more frecent plays
// This favours songs that have been played multiple times recently, so that songs you used to love do not stay at the top
// I find this surfaces fresher songs compared to DADA Auto-Rating
// Requires foo_enhanced_playcount for last.fm play history
// Get 10 most recent plays (truncating milliseconds)
$puts(len, $len(%lastfm_played_times_js%))
$puts(play0, $substr(%lastfm_played_times_js%, $sub($get(len), 13, $mul(0, 15)), $sub($get(len), 4, $mul(0, 15))))
$puts(play1, $substr(%lastfm_played_times_js%, $sub($get(len), 13, $mul(1, 15)), $sub($get(len), 4, $mul(1, 15))))
$puts(play2, $substr(%lastfm_played_times_js%, $sub($get(len), 13, $mul(2, 15)), $sub($get(len), 4, $mul(2, 15))))
@szupie
szupie / duolingo-keyboard-shortcut.js
Last active May 25, 2024 15:03
Duolingo keyboard shortcuts
// ==UserScript==
// @name Duolingo keyboard shortcuts
// @description Press Shift+Space to play sentence audio (plus adds number keys support for more word bank exercises)
// @version 1.1.8
// @match https://www.duolingo.com/*
// @grant none
// @author szupie szupie@gmail.com
// @namespace szupie
// @license Unlicense
// ==/UserScript==
@szupie
szupie / userChrome.css
Last active June 7, 2022 03:13
Styles to revert Firefox Proton tabs appearance, where the active tab is attached to the page below. Active tab is indicated by a line at the top, and background tabs are separated by a thin stroke.
/*** Proton Tabs Tweaks ***/
/* Modified from https://www.userchrome.org/firefox-89-styling-proton-ui.html#tabstyler
to previous tabs appearance with colour line over selected tab
*/
/* Adjust tab corner shape, optionally remove space below tabs */
#tabbrowser-tabs {
--user-tab-rounding: 0px;
}
@szupie
szupie / karabiner.json
Last active May 13, 2021 16:18
my karabiner config file
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {

Keybase proof

I hereby claim:

  • I am szupie on github.
  • I am szupie (https://keybase.io/szupie) on keybase.
  • I have a public key ASDgCAtSNzxGF8t93waZOcE95f_Cgy19iGv-aYkCzTfJAQo

To claim this, I am signing this object:

@szupie
szupie / x
Created January 4, 2009 02:29
Command for cached copy and backward links of the current page
function cmd_cached_copy() {
var url = Application.activeWindow.activeTab.document.location.href;
url = "http://www.google.com/search?hl=en&q=cache:" + url;
CmdUtils.getWindowInsecure().location = url;
}
cmd_cached_copy.description = "Searches for the cached copy of this page using Google.";
cmd_cached_copy.icon = "http://www.google.com/favicon.ico";
cmd_cached_copy.author = {name: "szupie", email: "szupie@gmail.com"};
function cmd_backward_links() {
@szupie
szupie / x
Created January 4, 2009 02:27
Google search with keyword "in" for site search
CmdUtils.CreateCommand({
name: "google",
icon: "http://www.google.com/favicon.ico",
searchURL: "http://www.google.com/search?hl=en&q=",
description: "Searches Google for your words.",
takes: {"keywords": noun_arb_text},
modifiers: {"in": noun_arb_text },
execute: function(keywords, modifiers) {
var query = this.buildQuery(keywords,modifiers);
@szupie
szupie / x
Created January 3, 2009 20:27
Ubiquity command to show add-ons window
CmdUtils.CreateCommand({
names: ["open add-ons window", "open addons window"],
description: "Opens the Add-ons window",
icon: "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png",
author: { name: "szupie", email: "szupie@gmail.com"},
preview: function(pblock) {
pblock.innerHTML = "Opens the Add-ons window";
},
execute: function(object) {
const EMURL = "chrome://mozapps/content/extensions/extensions.xul";