This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fut = None | |
async def antidogpile(coro, *args, **kwargs): | |
nonolocal fut | |
async def helper(): | |
nonlocal fut | |
try: | |
return await coro(*args, **kwargs) | |
finally: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(() => [...document.getElementsByClassName("disabled")].map(e => e.remove()), 500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import math | |
import sys | |
start = time.time() | |
total = int(sys.argv[1]) * 60 | |
deadline = start + total | |
def remains(): | |
now = time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" -*- 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 |