Skip to content

Instantly share code, notes, and snippets.

/app # wget https://raw.githubusercontent.com/python/cpython/master/Tools/gdb/libpython.py
...
/app # apk add gdb
...
/app # env PYTHONPATH=. gdb
GNU gdb (GDB) 8.2
...
fut = None
async def antidogpile(coro, *args, **kwargs):
nonolocal fut
async def helper():
nonlocal fut
try:
return await coro(*args, **kwargs)
finally:
""" Reproducer for BPO-39951
We send some data over ssl and close the connection.
The server responds after our openssl considers the connection closed-ish and raises an error.
"""
import asyncio
import ssl
host = "nghttp2.org"
port = 443
=== ubuntu buster
# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 280
# define SSL_R_INVALID_COMMAND 280
# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
# define SSL_R_INVALID_CONTEXT 282
# define SSL_R_INVALID_CONFIG 283
# define SSL_F_TLS1_PRF 284
# define SSL_R_NOT_SERVER 284
# define SSL_F_SSL3_FINAL_FINISH_MAC 285
const path = require("path");
const immer = require("immer");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const stats = process.argv.includes("--stats");
module.exports = (config, env) => immer.produce(config, draft => {
// I just happen to know these indices:
// https://github.com/facebook/create-react-app/issues/7581#issuecomment-535305630
draft.module.rules[2].oneOf[0].test.push(/[.]svg$/);
// Ad-hoc UseBabelRc()
from collections import Counter
from pathlib import Path
def ngrams(n, s):
# lazy, but trailing sub-n-grams are not statistically significant
for i in range(len(s)):
yield s[i:i+n]
setInterval(() => [...document.getElementsByClassName("disabled")].map(e => e.remove()), 500)
from collections import Counter
from pprint import pprint
BOARD = """
a a a a b
c c c a b
d d c b b
d e c c c
d e e e c
""".strip().splitlines()
import time
import math
import sys
start = time.time()
total = int(sys.argv[1]) * 60
deadline = start + total
def remains():
now = time.time()
" -*- coding: utf-8 -*-
" scriptencoding utf-8
set termencoding=utf-8
set termguicolors
set encoding=utf-8
setglobal fileencoding=utf-8
syntax on
set hls
set expandtab
set colorcolumn=88