Skip to content

Instantly share code, notes, and snippets.

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

Sven mainrs

⛩️
In zen
View GitHub Profile
@kozaxinan
kozaxinan / LabelWithBadge.kt
Last active August 30, 2023 14:02
A Jetpack compose implementation for displaying counter for hidden word becuase of text overflow
package foo
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
@grantbevis
grantbevis / minecraft-bedrock-server.nix
Last active January 17, 2024 13:00 — forked from datakurre/minecraft-bedrock-server.nix
Minecraft Bedrock Server 1.17.11.01 - NixOS module
{ config, lib, pkgs, ... }:
let
minecraft-bedrock-server = with pkgs; stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "minecraft-bedrock-server";
version = "1.17.11.01";
src = fetchurl {
url = "https://minecraft.azureedge.net/bin-linux/bedrock-server-1.17.11.01.zip";
@Ellivers
Ellivers / main.md
Last active January 11, 2024 14:07
Practices and Tricks

Good Data Pack Practices and Common Tricks

Structuring and Consistency

An organized structure to your data pack's folders and file names always helps you understand your code better and leads to less bugs. Place files that have something in common in the same folder, and name them based on what their purpose is.

Consistency in naming stuff like tags, files, and scores can help keep you sane. Always have a clear structure in place, such as prefixing tag and objective names with your namespace (namespace.name) and giving tags different categories (namespace.entity.name, namespace.block.name).

If you are unsure of how a good structure could look, you could take a look at some vanilla assets, such as the lang file or the built-in data pack, as well as get ideas from looking at data packs that other people have made.

@markus1189
markus1189 / dungeondraft.nix
Created March 27, 2021 14:20
Nix buildFHSEnv for DungeonDraft
{ pkgs ? import <nixpkgs> { } }:
(pkgs.buildFHSUserEnv {
name = "DungeonDraftFhs";
targetPkgs = pkgs:
with pkgs; [
alsaLib
libglvnd
pulseaudioLight
] ++ (with xlibs; [
@mainrs
mainrs / labels.json
Last active November 21, 2021 13:30
Label definition file for gh-labels-cli: https://github.com/mainrs/gh-labels-cli
{
"labels": [
{
"name": "type: bug",
"description": "Something isn't working",
"color": "ee0701"
},
{
"name": "type: enhancement",
"description": "New feature or request",
@comp500
comp500 / fabricserversidemods.md
Last active April 15, 2024 20:13
Useful Fabric server side mods
@leagris
leagris / github.sieve
Last active February 12, 2022 02:41
Sieve filter for GitHub notifications
# rule:[notifications@github.com]
#require ["fileinto", "mailbox", "variables", "imap4flags", "regex"];
if address :is "from" "notifications@github.com" {
set "gitfolder" "Lists.GitHub";
if header :matches "List-ID" "*<*.*.github.com>" {
set "gituser" "${3}";
set "gitrepository" "${2}";
# Replace . or + by dashes for proper IMAP folder name
# Sieve has no regex global replace, so do it at max 3 occurences
if string :regex "${gitrepository}" "(.*)[.+]+(.*)" {
@lu4nm3
lu4nm3 / main.rs
Last active January 16, 2024 09:38
Tokio Async: Concurrent vs Parallel
use futures::StreamExt;
use std::error::Error;
use tokio;
use tokio::macros::support::Pin;
use tokio::prelude::*;
use tokio::time::{Duration, Instant};
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut multi_threaded_runtime = tokio::runtime::Builder::new()
.threaded_scheduler()
@CRTified
CRTified / README.md
Last active March 24, 2024 18:03
VFIO Passthrough on NixOS

VFIO Setup on NixOS

Disclaimer: Nobody else tested my setup so far, so this is a "works on my machine" scenario. I am not responsible for anything you break on your machine (although I'd not expect much harm).

Hardware

My system has the following hardware:

  • Board: ASRock X570 Pro4
@gusmacaulay
gusmacaulay / shell.nix
Last active January 1, 2024 10:57 — forked from lightdiscord/shell.nix
Postgresql/Postgis inside nix-shell with sqitch and default postgres user
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "postgresql-inside-nixshell";
buildInputs = [
glibcLocales
(pkgs.postgresql.withPackages (p: [ p.postgis ]))
sqitchPg
pgcli