Skip to content

Instantly share code, notes, and snippets.

@th-yoo
th-yoo / poetry_how_to_fix_SSL_error.md
Last active January 26, 2025 12:12
SSLError: unable to get local issuer certificate (poetry 2.0 installed via pipx on macOS)

SSLError: unable to get local issuer certificate

$ poetry add git+https://github.com/th-yoo/niquests-ratelimiter.git

HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /th-yoo/niquests-ratelimiter.git/info/refs?service=git-upload-pack (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1018)')))

References

@th-yoo
th-yoo / test.py
Created July 9, 2023 10:49
Bokeh with FastAPI
from __future__ import annotations
from pprint import pprint
from var_dump import var_dump
from fastapi import FastAPI, WebSocket, Request, HTTPException, WebSocketDisconnect
from fastapi.responses import HTMLResponse, PlainTextResponse
from fastapi.staticfiles import StaticFiles
app = FastAPI()
@th-yoo
th-yoo / test_undefined_offset_exception.php
Last active September 1, 2019 11:48 — forked from mmacia/test_undefined_offset_exception.php
How to catch an invalid array index offset as a native exception in PHP (RAII supported)
<?php
/**
* this class shows how to override default PHP handler to catch undefined index errors
* and throw it as native exceptions, much more convenient way to work with object
* oriented programs.
*
* @author Moisés Maciá <[email protected]>
* @see http://codeup.net
*/
@th-yoo
th-yoo / stream_promise.js
Last active March 22, 2017 12:10
Promisify node stream
'use strict'
// (node -v) => 5.2.0
const stream = require('stream');
class StreamPromise {
constructor(stream) {
this._promises = [];
this._add(stream);
this._cur = stream;
@th-yoo
th-yoo / dumpbin.md
Created January 24, 2017 06:18
binary dumper functions

C

static void dumpbin( const void* beg, const void* end
		   , size_t stride)
{
	static const char n2a[]
	= { '0', '1', '2', '3', '4', '5', '6', '7'
	  , '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
	
	const unsigned char* cur = (const unsigned char*)beg;