Skip to content

Instantly share code, notes, and snippets.

@haryp2309
haryp2309 / fedora-silverblue-setup.md
Last active June 4, 2024 19:32
Fedora Silverblue Setup

Fedora Silverblue Setup

Systemd Services

  • Auto Update Dev Container (custom scripts, see below)
  • Logitech Service (logiops)
  • Auto Clean Downloads

Logitech MX Master 2S Setup

/etc/logid.cfg:

@haryp2309
haryp2309 / example.py
Created February 20, 2024 21:40
Functional Programming In Python3.11+
from functional import Functional
import numpy as np
# Results in a NDArray[int_]
out = (
Functional[str](["hei", "boo", "1", "2", "4"])
.filter(lambda x: x.isnumeric())
.map(lambda x: int(x))
.enumerate()
.map(lambda v: v[0] + v[1])
@haryp2309
haryp2309 / keymap.json
Last active March 26, 2024 11:02
FL Studio Karabiner Elements Keymap Mac (Norwegian Keyboard)
{
"description": "FL Studio",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.image-line\\.flstudio$"
],
"type": "frontmost_application_if"
@haryp2309
haryp2309 / README.md
Last active May 13, 2024 17:41
Python Multiprocessing Map Dictionary

Map Dictionary Using Python Multiprocessing

Simple utility function that can transform the values in a dictionary into a new dictionary using multiple threads, if used with Python Multiprocessing.

Installation

Copy the content of the attached dict_pool_map.py-file. A non-typed version is also attached to showcase an easy-to-read implementation (dict_pool_map_no_typing.py).

Usage

@haryp2309
haryp2309 / README.md
Last active June 26, 2024 00:50
Fedora Workstation Yoga 9i

Fedora Workstation Yoga 9i

Print Screen Keybinding

Run:

gsettings set org.gnome.shell.keybindings show-screenshot-ui "['Print', '<Shift><Super>s']"

Replace system apps with flatpaks

@haryp2309
haryp2309 / auto_trash_downloads_macos.py
Last active July 7, 2024 13:26
Auto Trash Downloads MacOS Python Script
# Trashing implementation is based on https://github.com/arsenetar/send2trash
# Requries pyobjc-library to be installed ("python3 -m pip install pyobjc")
import os
import time
from pathlib import Path
from subprocess import run
from Foundation import NSFileManager, NSURL
def notify(title, text):
@haryp2309
haryp2309 / just.py
Last active November 1, 2024 13:24
My Just Script
#! /bin/env python3
from dataclasses import dataclass
import argparse
from subprocess import run, check_output
from pathlib import Path
from typing import Optional
import logging
from os import environ