Skip to content

Instantly share code, notes, and snippets.

:bowtie:
Not wearing a bowtie

Joar Wandborg joar

:bowtie:
Not wearing a bowtie
Block or report user

Report or block joar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lobby_stats.py
import json
import multiprocessing
import datetime as dt
import logging
import time
from queue import Empty
import pandas as pd
from colorama import Fore
import pydivert
View utils.sh
#!/usr/bin/env bash
# This section should be copied to any script that uses it.
# BEGIN UTILS
# Utility functions ⚠ Do not edit ⚠ Automatically inserted by scripts/utils.sh
# ==============================================================================
# Does not capture stdout, prints helpful info to stderr
function show_call_passthrough {
View devtools-mark-vendor-as-viewed.js
fileHeaders = Array.slice(document.querySelectorAll(".file-header"))
MARK_AS_VIEWED_FILENAME_REGEX = /vendor\//
CAREFULNESS = 300
if (typeof AUTO_VIEWED_INTERVAL_HANDLE !== "undefined") {
clearInterval(AUTO_VIEWED_INTERVAL_HANDLE)
}
AUTO_VIEWED_INTERVAL_HANDLE = setInterval(() => {
View deadlock_pipeline.py
import logging
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions, SetupOptions
_log = logging.getLogger(__name__)
def main(argv=None):
logging.basicConfig(level=logging.INFO)
View dilllock.py
import threading
import dill
def main():
lock = threading.RLock()
dill_lock = dill.loads(dill.dumps(lock))
print(dill_lock) # Prints as "unlocked"
@joar
joar / async-middleware.md
Created May 4, 2018
GraphQL memory leak
View async-middleware.md
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
joar / README.md
Last active Nov 17, 2017
Hide tabs in Firefox 57
View README.md

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.
You can’t perform that action at this time.