Skip to content

Instantly share code, notes, and snippets.

@rain-1
rain-1 / base model trends.md
Last active July 4, 2025 06:29
base model trends.md
@brauliobo
brauliobo / netns-wg.service
Last active June 24, 2025 09:57
Wireguard VPN over a network namespace service for one specific app
# put in /etc/systemd/system/netns-wg.service
[Unit]
Description=Start a VPN Network Namespace
After=network.target
[Service]
Type=oneshot
RemainAfterExit=true
@ismasan
ismasan / concurrent_processing.rb
Last active August 27, 2024 21:59
Practical Railway-oriented Pipeline for Ruby
# A Pipeline extension to process steps concurrently
# Example
# class ConcurrentPipeline < Pipeline
# include ConcurrentProcessing
# end
#
# MyPipeline = ConcurrentPipeline.new do |pl|
# pl.step ValidateInput
#
# # These steps run concurrently
@masselstine
masselstine / 0000_UM3402YAR.md
Last active April 14, 2025 00:35
Linux on the Zenbook 14 OLED refresh (UM3402YAR)

Linux on the Zenbook 14 OLED (refresh) - Model UM3402YAR

BIOS

The latest BIOS is version 303 "UM3402YAR.303" (Release Date: 09/05/2023). All items posted here will be specific to the model number and BIOS version described here (BIOS 300, 302 were known working). Some things might be specific to Arch Linux but should be generic and portable to other distributions. There are no guarantees and should you wish to try any of this out it is assumed to be at your own risk.

Sound

The sound does not work out of the box (at least not on Arch but I am guessing for most Distros as well).

The patch 0001-ALSA-hda-realtek-Add-quirk-for-ASUS-UM3402YAR-using-.patch is required to be applied to kernels older than v6.4 to ensure that the Realtek sound device is properly bound to the Cirrus amplifiers. If you are using kernel v6.4 or newer this patch is not needed.

The ssdt_csc3551.dsl file can be used per the instructions found in the file header. No need to patch the DSDT, this is a stand-alone SSDT that is easily u

from marvin import ai_fn
@ai_fn
def generate_people(n: int) -> list[dict]:
"""Generates a list of n people with random names and ages."""
generate_people(n=2) # [{'name': 'Olivia', 'age': 30}, {'name': 'Ethan', 'age': 22}]
@amit
amit / db.rake
Last active May 4, 2025 19:48 — forked from hopsoft/db.rake
Update for rails 7.0.X and handle postgres password
# apt install postgresql-client
# apt-get -y install bash-completion wget
# wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
# echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
# apt-get update
# apt-get -y install postgresql-client-12
namespace :db do
desc "Dumps the database to backups"
@cmtsij
cmtsij / tailscale
Last active March 20, 2024 09:14
tailscale completion
#!/bin/bash
# tailscale completion -*- shell-script -*-
_tailscale()
{
local cur prev words cword
_init_completion -n = || return
if [[ $cword -eq 1 ]]; then
SUBCOMMANDS=$(tailscale --help 2>&1 | awk '/SUBCOMMANDS/{ f = 1; next } /FLAGS/{ f = 0 } f{print $1}')
@searls
searls / whereable.rb
Created September 4, 2021 16:06
The initial implementation of a Whereable query filter for KameSame.
class Whereable
def initialize(where:, model: Item, ranking_conditions: [], valid: true, data_source: nil)
@model = model
@where = where
@data_source = data_source
@ranking_conditions = ranking_conditions
@valid = valid
end
def valid?
@eminetto
eminetto / rfc.md
Created May 22, 2021 13:04
Template of RFCs

Title

Problem description

We must explain the problem clearly and identify additional details that the team needs to know. We must here describe the context, what we did so far, and the current state.

The description also serves as a trail that we can go back to in the future to understand the reasoning we had at the time and see what restrictions and requirements have changed.

Possible approaches

@ijoseph
ijoseph / option_remappers.json
Created November 9, 2020 06:06
Option-G to Option-Command-G MacOS
{
"title": "Remap Useless Option Symbol Keys",
"rules": [
{
"description": "Remap Option-G to Option-Command-G",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "g",