Skip to content

Instantly share code, notes, and snippets.

View frippz's full-sized avatar
:octocat:

Fredrik Frodlund frippz

:octocat:
View GitHub Profile
@frippz
frippz / tamperMonkeyRedirectToOldReddit.js
Created April 6, 2024 09:38
Redirect to Old Reddit
// ==UserScript==
// @name Redirect to Old Reddit
// @namespace https://frippz.se/
// @version 1.1.0
// @description Redirects to old.reddit.com
// @author Fredrik Frodlund
// @match *://reddit.com/*
// @match *://www.reddit.com/*
// @match *://np.reddit.com/*
// @match *://amp.reddit.com/*
@frippz
frippz / Dialog.svelte
Last active March 26, 2024 11:01
Native HTML dialog element in Svelte
<script>
export let dialog
</script>
<dialog bind:this={dialog} on:close>
<slot/>
</dialog>
@frippz
frippz / .htmlhintrc
Created August 31, 2022 18:24
HTMLHint
{
"tagname-lowercase": true,
"attr-lowercase": ["viewBox"],
"attr-value-double-quotes": true,
"attr-value-not-empty": false,
"attr-no-duplication": true,
"doctype-first": true,
"tag-pair": true,
"tag-self-close": false,
"spec-char-escape": true,
@frippz
frippz / speedtest.sh
Created April 7, 2021 05:26
Test network speed without wasting disk
dd if=/dev/zero bs=4096 count=1048576 | ssh user@host.tld 'cat > /dev/null'
@frippz
frippz / unSticky.js
Last active September 8, 2020 07:51
Un-sticky toolbars and kill fixed elements bookmarklet, and possibly re-enable scrolling of the page
const elements = document.querySelectorAll('body *');
const containers = document.querySelectorAll('html, body');
containers.forEach(el => {
if (getComputedStyle(el).overflow === 'hidden') {
el.style.setProperty ('overflow', 'unset', 'important');
}
});
elements.forEach(function (element) {
@frippz
frippz / prototypeButtons.js
Last active May 3, 2019 06:00
Mocking user actions with buttons
/**
* prototypeButtons
*
* Listen for click event across the document & trigger on
* buttons that have a data-prototype-url attribute.
*
* Usage:
* <button type="button" data-prototype-url="page.html">Click me</button>
*
* Do NOT use this in production. That’s what links are for.
@frippz
frippz / karabiner-1password.json
Last active November 24, 2017 10:48
Open 1Password Mini with F13
{
"description": "Open 1Password Mini",
"manipulators": [
{
"from": {
"key_code": "f13"
},
"to": [
{
"key_code": "backslash",
@frippz
frippz / dyslexicMode.js
Created March 11, 2017 15:59
Toggle dyslexic mode
/**
* Toggle dyslexic mode
*/
function dyslexicMode() {
// Place button inside role="banner"
var toggleContainer = document.querySelector('[role="banner"] .landmark-content');
// Create toggle button
toggleContainer.insertAdjacentHTML('beforeend', '<button type="button" class="toggle-dyslexic-mode" data-text-original="Enable dyslexic mode" data-text-swap="Disable dyslexic mode">Enable dyslexic mode</button>');
@frippz
frippz / styles.css
Last active February 16, 2017 13:19
Binhs lekplats CSS
/* stylelint-disable at-rule-empty-line-before */
/**
* CSS Resets
*
* Resets so that we start of with the same styles cross-browser
*/
/**
* HTML5 elements legacy reset
*/
article,
@media screen {
.cell {
outline: 1px solid green;
}
.cell-group {
outline: 1px solid red;
}