Skip to content

Instantly share code, notes, and snippets.

View frippz's full-sized avatar
:octocat:

Fredrik Frodlund frippz

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am frippz on github.
  • I am frippz (https://keybase.io/frippz) on keybase.
  • I have a public key whose fingerprint is 245A C595 B915 4DBB 4EB2 80DC 4BE1 FF81 2E2B E0D0

To claim this, I am signing this object:

@frippz
frippz / feed.xml
Created January 3, 2017 10:35
Sample feed from Hemnet
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<image>
<title>Hemnet</title>
<link>http://www.hemnet.se/</link>
<url>http://www.hemnet.se/images/logga_hemnet.gif</url>
</image>
<link>http://www.hemnet.se/mitt_hemnet/sparade_sokningar/11466596.xml</link>
<title>Hemnet bostadsbevakning - Gårdar i sydvästra Skåne</title>
@media screen {
.cell {
outline: 1px solid green;
}
.cell-group {
outline: 1px solid red;
}
@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,
@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 / 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 / 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 / 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 / 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 / .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,