Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"upstream": {
"cline-ch": {
"shape": [
7954,
3465
],
"doublets": [
0,
43,
We couldn’t find that file to show.
Pandas ExtensionArray / ExtensionDType for UUID
@flying-sheep
flying-sheep / fix_jar_mime.sh
Created September 29, 2011 14:41
A bug exists for ages in Kubuntu (and afaik only there) that can be fixed by removing a superfluous file and rebuilding the MIME DB.
#!/bin/bash
ROOT_UID=0
FIX_JAR_MIME="rm -vf /usr/share/mime/packages/sun-java*-jre.xml
update-mime-database /usr/share/mime"
if [ "$UID" -ne "$ROOT_UID" ]; then
kdesudo -c "$FIX_JAR_MIME"
kbuildsycoca4 #only possible if run as underprivileged
else
"$FIX_JAR_MIME"
@flying-sheep
flying-sheep / index.html
Last active November 23, 2022 12:24
react-slide-routes demo
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="importmap">
{
"imports": {
"@emotion/react": "https://esm.sh/@emotion/react@11.10.5?dev",
import sys
import os
from http import HTTPStatus
from http.server import HTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
from io import StringIO, BytesIO
from pep2html import PEP_TYPE_DISPATCH
here = Path(__file__).parent
@flying-sheep
flying-sheep / setup.py
Created December 2, 2020 14:17
Use flit metadata from setup.py
"""Temporary setuptools bridge
Don't use this except if you have a deadline or you encounter a bug.
"""
import re
import setuptools
from pathlib import Path
from flit_core import common, config
from setuptools_scm.integration import find_files
/node_modules/
/package-lock.json
#!/bin/zsh
zmodload zsh/mathfunc
local usage="Usage: ${0##*/} [-p lastpage] PDF"
local -a help pages
zparseopts -D h=help -help=help p:=pages
if (( ! $# )); then