This file contains hidden or 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
| #!/bin/bash | |
| scrot -s -f "-" | tesseract - - 2>/dev/null | xclip -selection clipboard -i |
This file contains hidden or 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 __future__ import annotations | |
| from abc import ABC, abstractmethod | |
| from typing import Self, override | |
| from collections.abc import Callable | |
| import pydantic | |
| class FooV1(pydantic.BaseModel): | |
| a: int | |
| b: str |
This file contains hidden or 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
| #!/bin/bash | |
| DIR="/tmp/screenshots" | |
| mkdir -p "$DIR" | |
| TIMESTAMP=$(date +%Y-%m-%dT%H-%M-%S) | |
| FILE=$(mktemp -u -p "$DIR" -t "$TIMESTAMP-XXXXX.png") | |
| scrot -e 'xclip -selection clipboard -t image/png -i $f' "$@" "$FILE" && echo "$FILE" |
This file contains hidden or 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 vectorize import ( | |
| categorize_class, | |
| categorize_bool, | |
| categorize_num, | |
| make_vectorize, | |
| ) | |
| @categorize_class(["FIN", "MISC"], weight=10) | |
| def module_cat(d): |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import code | |
| import ctypes | |
| import inspect | |
| import logging | |
| def hook( | |
| banner_msg: str | None = None, |
This file contains hidden or 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
| class Lazy: | |
| def __init__(self, fun, *args, **kwargs): | |
| self.fun = fun | |
| self.args = args | |
| self.kwargs = kwargs | |
| self.executed = False | |
| self.value = None | |
| # Binary Operators | |
| def __binary__(self, binfun, other): |
This file contains hidden or 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
| package main; | |
| public interface Lazy<R> { | |
| public R force(); | |
| } |
This file contains hidden or 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
| -- Compile with -threaded | |
| import System.IO | |
| import Control.Concurrent | |
| import Control.Concurrent.STM | |
| -- (<Sum>, <Number of finished transactions>) | |
| type Result = TVar (Int, Int) | |
| -- Adds x to result and increments the number of finished transactions |
This file contains hidden or 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
| -- Compile with -threaded | |
| import System.IO | |
| import Control.Concurrent | |
| getGreeting :: IO String | |
| getGreeting = do | |
| -- Get id and convert to string | |
| tid <- myThreadId | |
| let greeting = "Hello from " ++ show tid |
This file contains hidden or 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
| -- Compile with the -XScopedTypeVariables flag. | |
| -- e.g. ghc -Wall -XScopedTypeVariables Main.hs | |
| import Control.Exception | |
| data MyError = Error deriving Show | |
| instance Exception MyError | |
| failing :: IO () |
NewerOlder