Skip to content

Instantly share code, notes, and snippets.

View safijari's full-sized avatar

Jari safijari

View GitHub Profile
@safijari
safijari / orgmode_spacemacs.org
Last active May 30, 2023 16:11
Org mode spacemacs tutorial file

I hope the tutorial has been useful to you. If it was kindly leave a like and a comment, and consider subscribing and turning on subscription notifications. I intend to make more videos like this on the topics mentioned before as well as on other spacemacs topic like magit (git plugin), large scale refactoring, and a number of other things. Thank you so much for watching.

Org tutorial

Note: a great reference can be had here http://spacemacs.org/layers/+emacs/org/README.html

Outlines/headers

Show that each outline has it’s associated “text” under it

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@safijari
safijari / argh_examples.py
Created March 20, 2020 07:16
Python Libraries Video 1
import argh
def do_the_thing(required_arg, optional_arg=1, other_optional_arg=False):
"""
I am a docstring
"""
print((required_arg, type(required_arg)))
print((optional_arg, type(optional_arg)))
print((other_optional_arg, type(other_optional_arg)))
### Keybase proof
I hereby claim:
* I am safijari on github.
* I am safijari (https://keybase.io/safijari) on keybase.
* I have a public key whose fingerprint is 5B01 E68E 96F2 7E9C 3D1A 7E15 4188 14D7 C0ED 743C
To claim this, I am signing this object:
@safijari
safijari / CMakeLists.txt
Created April 1, 2021 20:56
The code relevant to pybind11 video
cmake_minimum_required(VERSION 3.4...3.18)
project(pybindtest)
add_subdirectory(pybind11)
pybind11_add_module(module_name main.cpp)
@safijari
safijari / gist:1cc2d3c567f8c04a434ef080cb8a302a
Created April 10, 2023 16:06
pipewire gamescope bug investigation and info
Last pipewire commit that works: https://github.com/PipeWire/pipewire/commit/76313161866db1a48a798da1ff8e196de747d238
@safijari
safijari / readme.org
Last active October 14, 2025 19:19
How to use Orange Pi 5B for 4k 120hz (non HDR) streaming with Moonlight

IMPORTANT: DON’T USE THIS GUIDE AS IS. GNOME HAS A WEIRD VSYNC ISSUES. Instead you can use the official Debian image and make sure all the updated drivers are installed and the rest should remain the same.

Preamble

This guide is made using the Orange Pi 5B 4GB+32GB. The device is capable of handling a 4k 120hz stream but you should know that the decode time for 4k stream hovers around 8ms and can spike up to 15ms during a benchmark. I can’t feel any added latency from it and I don’t have any dropped frames. The decode time goes down to 4ms for 1440p. It’s certainly not the blazing fast sub ms decode latency we get on the Steam Deck or mini PCs. I bought the device for $99 and for that price I think this performance is fantastic, but your mileage/expecations may vary.

How to get this result (or rather how I got it)

  1. Install the official Gnome Ubuntu Jammy image using Balena Etcher onto a 16+ GB microSD card
@safijari
safijari / setup.sh
Created November 13, 2023 19:43
Script for getting set up to build gamescope with rwfus enabled
#!/bin/bash
sudo rm /etc/ld.so.conf.d/lib32-fakeroot.conf
sudo rm /etc/ld.so.conf.d/fakeroot.conf
sudo rm /etc/ssh/sshd_config.d/99-archlinux.conf
sudo rm -rf /etc/pacman.d/gnupg/ || :
sudo pacman-key --init
sudo pacman-key --populate
sudo pacman -Sy --noconfirm --needed archlinux-keyring
sudo pacman --noconfirm -S $(pacman -Qnkq | cut -d' ' -f1 | sort | uniq)
sudo pacman -S base-devel multilib-devel --needed
@safijari
safijari / Readme.md
Created November 30, 2023 14:55
Defringing for OLED Steam Deck Samsung Panel

tldr: Fringing happens because the subpixels are not properly aligned. It can be alleviated by "shifting" the underlying data to colocale in the center of the pixel. On the Samsung Panel, a simplistic solution to this is as follows:

green_amt = 0.2
red_amt = 0.4
blue_amt = 0.3
for i in range(1, im.shape[0]-1):
    for j in range(1, im.shape[1]-1):
 green_out[i, j] = green[i, j+1]*(green_amt) + green[i, j]*(1-green_amt)
@safijari
safijari / gist:372dbd0eaf10fa66f71cc3c9d5ba1c08
Created March 4, 2024 02:37
DFL independent plugins how
Move decky-frontend-lib to a devDependency
In your Rollup config:
add decky-frontend-lib to external
add 'decky-frontend-lib': 'DFL' to output.globals