Skip to content

Instantly share code, notes, and snippets.

View mainrs's full-sized avatar
⛩️
In zen

Sven mainrs

⛩️
In zen
View GitHub Profile
@unnamedd
unnamedd / MacEditorTextView.swift
Last active May 27, 2025 14:38
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://bsky.app/profile/tholanda.com
*
* (the twitter account is now deleted, please, do not try to reach me there)
* https://twitter.com/tholanda
*
* MIT license
*/
@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active June 18, 2025 12:38
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@magillus
magillus / example.kt
Created April 11, 2019 14:11
Koin helper methods for module definition with Generic types - here StateMachine is generic
///define in module
val stateMachineModule = module {
stateFactory{ TestImplStateMachine() } bind StateMachine::class
}
/// inject or get
val stateMachineTest:StateMachine<MyState> = getSm()
///class of state machine
class TestImplStateMachine : StateMachine<MyState> {
@cb372
cb372 / riscv.md
Last active April 9, 2025 19:53
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@ssell
ssell / FrustumPlanes.cs
Last active January 17, 2022 05:36
Implementation of a Unity ECS instanced Sprite renderer with basic frustum culling.
using Unity.Mathematics;
using Unity.Rendering;
using UnityEngine;
namespace Realms
{
/// <summary>
/// Based on Unity.Rendering.FrustumPlanes since those aren't public for some reason.
/// </summary>
public struct FrustumPlanes
@santiagobasulto
santiagobasulto / README.md
Last active February 17, 2025 16:05
Download HumbleBundle books in batch with a simple Python script.

Download HumbleBundle books

This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.

(Final Result: books downloaded)

@zats
zats / rich-reminders.swift
Created April 7, 2018 21:08
This is a sample of how to add actionable button for Reminders (private API); demo video: https://youtu.be/q7LrO3VhI64
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
let reminderListName = "Test"
import EventKit
extension EKCalendarItem {
var hack_action: AnyObject? {
set {
@niieani
niieani / example.sh
Created March 8, 2018 18:19
Bash Module System
#!/usr/bin/env bash
SCRIPT_DIR=${BASH_SOURCE[0]%/*}
# load our module system:
source "${SCRIPT_DIR}/module.sh"
# below command imports module ./greeter.sh and run its 'greet' function with the following arguments:
module greeter greet tterranigma
module greeter greet niieani
Basic
=====
[Shift]+[Mod]+[Enter] - launch terminal.
[Mod]+[b] - show/hide bar.
[Mod]+[p] - dmenu for running programs like the x-www-browser.
[Mod]+[Enter] - push acive window from stack to master, or pulls last used window from stack onto master.
[Mod] + [j / k] - focus on next/previous window in current tag.
@agrcrobles
agrcrobles / android_instructions_29.md
Last active February 15, 2025 21:03 — forked from patrickhammond/android_instructions.md
Setup Android SDK on OSX with and without the android studio

Hi, I am a fork from https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03.

A high level overview for what I need to do to get most of an Android environment setup and maintained on OSX higher Catalina and Big Sur with and without Android Studio been installed.

Considering the SDK is installed under /Users/<your_user>/Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.

Prerequisites:

https://github.com/shyiko/jabba instead ?