Skip to content

Instantly share code, notes, and snippets.

🤔

Fredrik Frodlund frippz

🤔
View GitHub Profile
@frippz
frippz / unSticky.js
Last active Sep 23, 2019
Un-sticky toolbars and kill fixed elements bookmarklet, and possibly re-enable scrolling of the page
View unSticky.js
(function () {
const elements = document.querySelectorAll('body *');
const body = document.querySelector('body');
if (getComputedStyle(body).overflow === 'hidden') {
body.style.overflow = 'unset';
}
elements.forEach(function (element) {
if (['-webkit-sticky', 'sticky'].includes(getComputedStyle(element).position)) {
@frippz
frippz / prototypeButtons.js
Last active May 3, 2019
Mocking user actions with buttons
View prototypeButtons.js
/**
* 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 Nov 24, 2017
Open 1Password Mini with F13
View karabiner-1password.json
{
"description": "Open 1Password Mini",
"manipulators": [
{
"from": {
"key_code": "f13"
},
"to": [
{
"key_code": "backslash",
@frippz
frippz / dyslexicMode.js
Created Mar 11, 2017
Toggle dyslexic mode
View dyslexicMode.js
/**
* 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 Feb 16, 2017
Binhs lekplats CSS
View styles.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,
View gca.css
@media screen {
.cell {
outline: 1px solid green;
}
.cell-group {
outline: 1px solid red;
}
@frippz
frippz / feed.xml
Created Jan 3, 2017
Sample feed from Hemnet
View feed.xml
<?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>
View keybase.md

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 / theme.zsh
Created Feb 23, 2016
ZSH prompt theme
View theme.zsh
autoload colors && colors
PROMPT='
$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
'
PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
@frippz
frippz / neovim-vimrc-symlink.sh
Created Feb 17, 2016
Symlink .vimrc etc for Neovim
View neovim-vimrc-symlink.sh
You can’t perform that action at this time.