Skip to content

Instantly share code, notes, and snippets.

View nup002's full-sized avatar

Magne Lauritzen nup002

View GitHub Profile
@nup002
nup002 / gist:e26b09c8d4788d1cc9543631bb8ae2b0
Created August 29, 2025 17:48
karabiner input switcher
{
"title": "Unicode Keypad Processor",
"rules": [
{
"description": "Switch to Unicode Hex Input on Option hold",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_option"
{
"title": "Unicode Keypad Processor",
"rules": [
{
"description": "Unicode hex input with Option key",
"manipulators": [
// Handle Left Option key - convert and type on release
{
"type": "basic",
"from": {
@nup002
nup002 / import_optional_cupy.py
Last active February 9, 2024 07:59
A code snippet to import optional cupy
"""
This Gist illustrates how you can import cupy when it may or not be installed. Also works with frozen applications.
If cupy is not installed, or the CUDA_PATH system variable is not set, or the incorrect CUDA version is installed
(relevant for frozen applications), is_cupy_available = False.
"""
import warnings
is_cupy_available = False

Keybase proof

I hereby claim:

  • I am nup002 on github.
  • I am maggel (https://keybase.io/maggel) on keybase.
  • I have a public key ASD11eyRca9f5kSF37f1h4VEHQ27Tv0Fn_NUSCdeVXzNYgo

To claim this, I am signing this object: