Skip to content

Instantly share code, notes, and snippets.

# This is Git's per-user configuration file.
[user]
name = Dima Tisnek
email = dimaqq@gmail.com
[alias]
tree = log --all --decorate --oneline --graph
ls = log --decorate --graph
st = status
branchdate = for-each-ref --sort='-committerdate:iso8601' --format=' %(committerdate:iso8601)%09%(refname)' refs/heads
[diff "minjs"]
functions -c fish_prompt _raw_fish_prompt
function fish_prompt
string replace user@MACHINE … (_raw_fish_prompt)
end
set -x LANG en_GB.UTF-8
alias v=vim
" -*- 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
import time
import math
import sys
start = time.time()
total = int(sys.argv[1]) * 60
deadline = start + total
def remains():
now = time.time()
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()
setInterval(() => [...document.getElementsByClassName("disabled")].map(e => e.remove()), 500)
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]
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()
=== 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
""" 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