Skip to content

Instantly share code, notes, and snippets.

@haakonn
haakonn / s3fs-delcache.sh
Created January 27, 2019 20:27
Script to expire files from s3fs-fuse's cache, with support for spaces in file names
#!/bin/bash
# Modified version of https://github.com/s3fs-fuse/s3fs-fuse/blob/master/test/sample_delcache.sh
# to support spaces in filenames (trade-off: filenames cannot contain "¼", which should be OK for most).
#
# This is unsupport sample deleting cache files script.
# So s3fs's local cache files(stats and objects) grow up,
# you need to delete these.
# This script deletes these files with total size limit
# by sorted atime of files.
@haakonn
haakonn / btno-nopaywall.user.js
Created December 4, 2016 12:51
btno-nopaywall.user.js - bt.no uten betalingsmurinnhold
// ==UserScript==
// @name btno-nopaywall
// @namespace haakonnilsen.com
// @include http://www.bt.no/*
// @version 1
// @grant none
// ==/UserScript==
function remAll(xpath) {
var els = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
@haakonn
haakonn / bano-nopaywall.user.js
Last active December 5, 2016 14:07
Les ba.no uten betalingsmurede artikler
// ==UserScript==
// @name bano-nopaywall
// @namespace haakonnilsen.com
// @include http://www.ba.no/*
// @version 1
// @grant none
// ==/UserScript==
function remAll(xpath) {
var els = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
@haakonn
haakonn / sportsfri-aftenposten.user.js
Created January 23, 2016 17:14
Sportsfri Aftenposten
// ==UserScript==
// @name Sportsfri Aftenposten
// @namespace http://haakonnilsen.com
// @description Aftenposten uten sport
// @include http://www.aftenposten.no/*
// @include https://www.aftenposten.no/*
// @include http://www.ba.no/
// @include http://www.bt.no/*
// @include https://www.vg.no/
// @grant none
@haakonn
haakonn / sportsfri-bt.user.js
Created January 23, 2016 17:13
Sportsfri Bergens Tidende
// ==UserScript==
// @name Sportsfri Bergens Tidende
// @namespace http://haakonnilsen.com
// @description Bergens Tidende uten sport
// @include http://www.bt.no/*
// @grant none
// ==/UserScript==
var boring = "sport|fotball|live|sprek";
var filterRE = new RegExp(boring);
@haakonn
haakonn / bt-abonnent.user.js
Last active December 14, 2016 13:48
Les abonnent-innhold på bt.no med Greasemonkey
// ==UserScript==
// @name bt-abonnent
// @namespace haakonnilsen.com
// @include http://www.bt.no/*
// @version 2
// @grant none
// ==/UserScript==
// Only works with JavaScript disabled. You can use YesScript for this.
@haakonn
haakonn / repeat.scala
Created April 21, 2015 20:38
Implementing the repeat loop in Scala
/*
Enables loops such as this:
var i = 10
repeat {
print(s"i is $i\n")
i = i - 1
} until (i == 0)
*/

Keybase proof

I hereby claim:

  • I am haakonn on github.
  • I am haakon (https://keybase.io/haakon) on keybase.
  • I have a public key whose fingerprint is 4259 AFED 9A07 B544 DDA9 B948 F0E7 C547 5B3F C330

To claim this, I am signing this object:

Rank Who Followers Following Ratio
1 BTCFoundation 35407 224 158.06697
2 learnemacs 4834 414 11.676329
3 B1TCOIN 21869 9725 2.2487404
4 BitcoinPRBuzz 13507 6483 2.0834491
5 magistratic 58 28 2.0714285
6 EVRY_ASA 657 364 1.8049451
7 erikfossen 1483 868 1.7085253
8 klingsen 386 258 1.496124
Verifying myself: My Bitcoin username is +haakon. https://onename.io/haakon