Skip to content

Instantly share code, notes, and snippets.

Not wearing a bowtie

Joar Wandborg joar

Not wearing a bowtie
View GitHub Profile
import threading
import dill
def main():
lock = threading.RLock()
dill_lock = dill.loads(dill.dumps(lock))
print(dill_lock) # Prints as "unlocked"
joar /
Created May 4, 2018
GraphQL memory leak
async def monitoring(handler, root, info: ResolveInfo, **kwargs):
    t_start = time.perf_counter()
    result = handler(root, info, **kwargs)

    if not isawaitable(result):
        return result

    result = await result
 duration = max(time.perf_counter() - t_start, 0)
View magic-icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
joar /
Last active Nov 17, 2017
Hide tabs in Firefox 57

Hide tabs in Firefox 57

Place userChrome.css in ~/.mozilla/firefox/*.default/chrome/. Create the chrome folder if it does not exist.

  • Hide the tab bar at the top of the window.
  • Shrink sidebar-header.
  • Make sidebar-header dark.
joar /
Created Nov 2, 2017
gunicorn - disable logging configuration
import gunicorn.glogging
import structlog
_logger = structlog.get_logger(__name__)
class Logger(gunicorn.glogging.Logger):
def setup(self, cfg):
joar /
Last active Nov 1, 2017

Keybase proof

I hereby claim:

  • I am joar on github.
  • I am joar ( on keybase.
  • I have a public key ASDguJoosHWHVEV2ET5ZsmTMDMbBz9Nf36vJ8ZzIxFEsnQo

To claim this, I am signing this object:

"""Terminal utilities."""
# Author: Steen Lumholt.
from termios import *
__all__ = ["setraw", "setcbreak"]
# Indexes for termios list.
# Subcommand parsing
function __kctl_pos_args
set -l pos_args (__fish_print_cmd_args_without_options)
# echo __fish_print_cmd_args_without_options pos_args $pos_args > /dev/stderr
# remove "kubectl"
set -e pos_args[1]
string join \n $pos_args