Skip to content

Instantly share code, notes, and snippets.

@safijari
safijari / readme.org
Last active March 5, 2025 07:09
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
@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@hortonew
hortonew / setup-bevy-0.15-project-for-android.sh
Last active March 5, 2025 07:02
setup-bevy-0.15-project-for-android.sh
#!/bin/zsh
# Grab PROJECT from Cargo.toml project.name
PROJECT=$(grep "name" Cargo.toml | cut -d '"' -f 2 | head -n 1)
PROJECT_ORG="bevyengine"
PROJECT_ORG_STRUCTURE="org.${PROJECT_ORG}.${PROJECT}"
BEVY_RELEASE="refs/heads/release-0.15.2"
echo "Creating new Bevy project: ${PROJECT} with organization structure: ${PROJECT_ORG_STRUCTURE}"
@kmcquade
kmcquade / jenkins-decrypt.md
Last active March 5, 2025 07:01 — forked from tuxfight3r/jenkins-decrypt.groovy
Decrypting Jenkins Password

To Decrypt Jenkins Passwords

  1. Go to the "Configure System" screen.
  2. Right click on a password field, Inspect element, then change to "text" instead of "password".
  3. Copy that field and then go to the Script Console. Paste the below into the field, replace with your encrypted password, and then hit "run".
encrypted_pw = '{your_encrypted_password_with_brackets_around_it}'
passwd = hudson.util.Secret.decrypt(encrypted_pw)
println(passwd)
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active March 5, 2025 07:00
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@AliSoftware
AliSoftware / struct_vs_inheritance.swift
Last active March 5, 2025 06:57
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@marjanmo
marjanmo / pygrib_wrapper_example.py
Last active March 5, 2025 06:56
PYGRIB wrapper for reading and filtering grib files - with examples
"""
A set of my pandas-like wrappers around pygrib.open() and pygrib.select() functionality that I find it bit more
intuitive and useful for my workflow. It also contains a patch to the "GRIB API stepUnits error" when reading gribs
with stepUnits below 1 hour.
DEPENDECIES: Numpy, Pandas and of course pygrib (with GRIB API C library available on system!).
Use at your own risk. Any corrections, suggestions, improvements and comments welcome!
Author: Marjan Moderc, Slovenian Environment Agency (ARSO), 2017 (email: marjan.moderc@gov.si)
@fewwwww
fewwwww / config.md
Created May 18, 2024 04:58
常熟阿诺 GPT
@qin-yu
qin-yu / configure-git.md
Last active March 5, 2025 06:52
Configure Git and setup GitHub on new machine
@willccbb
willccbb / grpo_demo.py
Last active March 5, 2025 06:51
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer