Skip to content

Instantly share code, notes, and snippets.

View joar's full-sized avatar
:bowtie:
Not wearing a bowtie

Joar Wandborg joar

:bowtie:
Not wearing a bowtie
View GitHub Profile
@joar
joar / test.rst
Last active January 2, 2018 12:45

Note

Single colon

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joar
joar / async-middleware.md
Created May 4, 2018 09:53
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)
import threading
import dill
def main():
lock = threading.RLock()
dill_lock = dill.loads(dill.dumps(lock))
print(dill_lock) # Prints as "unlocked"
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)
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(() => {
#!/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 {
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
import flask
from opencensus.ext.flask.flask_middleware import FlaskMiddleware
from opencensus.trace import utils, execution_context
from opencensus.trace.blank_span import BlankSpan
ATTR_REQUEST_BLACKLISTED = "request_blacklisted"
class FixedFlaskMiddleware(FlaskMiddleware):
def _before_request(self):
variables
{
global:
0: roundCount
1: roundKills
2: C_canBuyReinhardtIfMoreThan_3
3: bool_ShowConnectPower
4: arrSlot_PlayerDead
9: arrEntity_TeleporterActive
10: int_TeleporterPhase