Skip to content

Instantly share code, notes, and snippets.

View d4rken's full-sized avatar
πŸ™‚

Matthias Urhahn d4rken

πŸ™‚
View GitHub Profile
@riggaroo
riggaroo / CaptureComposable.kt
Last active October 24, 2025 11:28 — forked from iamcalledrob/CaptureComposable.kt
Android headless composable capture
/*
* Copyright 2025 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jamesjmtaylor
jamesjmtaylor / CaptureComposable.kt
Last active October 24, 2025 11:28 — forked from iamcalledrob/CaptureComposable.kt
Android headless composable capture
import android.app.Presentation
import android.content.Context
import android.content.Context.DISPLAY_SERVICE
import android.graphics.Bitmap
import android.graphics.Picture
import android.graphics.SurfaceTexture
import android.hardware.display.DisplayManager
import android.view.Display
import android.view.Surface
import android.view.ViewGroup
@nikvdp
nikvdp / atuin.zsh
Created August 18, 2022 14:44
Use atuin to power ctrl-r history search but with fzf. Also disable atuin's up arrow bindings and use ctrl-e to bring up atuin's own tui
# make sure you have `tac` [1] (if on on macOS) and `atuin` [2] installed, then drop the below in your ~/.zshrc
#
# [1]: https://unix.stackexchange.com/questions/114041/how-can-i-get-the-tac-command-on-os-x
# [2]: https://github.com/ellie/atuin
atuin-setup() {
! hash atuin && return
bindkey '^E' _atuin_search_widget
export ATUIN_NOBIND="true"
@jv-k
jv-k / bump-version.sh
Last active June 23, 2025 00:19
This script automates bumping the git software project's version using automation ⚠️ For an updated version, please see https://github.com/jv-k/ver-bump β€” a CLI module you can use with your projects ⚠️
#!/bin/bash
#
# β–ˆβ–„β–„ β–ˆβ–‘β–ˆ β–ˆβ–€β–„β–€β–ˆ β–ˆβ–€β–ˆ β–„β–„ β–ˆβ–‘β–ˆ β–ˆβ–€β–€ β–ˆβ–€β–ˆ β–ˆβ–€ β–ˆ β–ˆβ–€β–ˆ β–ˆβ–„β–‘β–ˆ
# β–ˆβ–„β–ˆ β–ˆβ–„β–ˆ β–ˆβ–‘β–€β–‘β–ˆ β–ˆβ–€β–€ β–‘β–‘ β–€β–„β–€ β–ˆβ–ˆβ–„ β–ˆβ–€β–„ β–„β–ˆ β–ˆ β–ˆβ–„β–ˆ β–ˆβ–‘β–€β–ˆ
#
# Description:
# - This script automates bumping the git software project's version using automation.
# - It does several things that are typically required for releasing a Git repository, like git tagging,
# automatic updating of CHANGELOG.md, and incrementing the version number in various JSON files.
@Zhuinden
Zhuinden / FragmentViewBindingDelegate.kt
Last active October 27, 2025 16:26
Fragment view binding delegate
// https://github.com/Zhuinden/fragmentviewbindingdelegate-kt
import android.view.View
import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import androidx.viewbinding.ViewBinding
import kotlin.properties.ReadOnlyProperty
@dragon788
dragon788 / .crypt-fix.md
Last active June 16, 2024 21:51
Repair "ubuntu--vg-root" not found with LUKS and LVM encryption

Crypt-fix

Use this script via curl -L -O https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80/raw/a86f3d05fb56feb6ef01fc2d61a4feb2fd82b281/crypt-fix.sh and sudo bash ./crypt-fix.sh. You may need to edit the DEVICE variable to reflect your disk and partition layout (this was created on an EFI system using LUKS and LVM). It will prompt you for your disk password once to mount and discover the correct name for the encrypted volume mount and then prompt again to mount with the correct name so that the update-initramfs command succeeds with the appropriate mapping, if this wasn't done you would get a warning and your next boot would still fail.

@d4rken
d4rken / gist:787061bd1f059e789061224a2a886d5e
Created July 16, 2018 19:37
Tutorial for self-hosted mail servers
A collection of guides/sites/posts that you may want to look through when setting up a mail server.
### General
* https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin
### Postfix (SMTP)
* https://seasonofcode.com/posts/custom-domain-e-mails-with-postfix-and-gmail-the-missing-tutorial.html
* https://seasonofcode.com/posts/setting-up-dkim-and-srs-in-postfix.html
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@musale
musale / fix.md
Last active January 17, 2025 01:13
How to fix and recover a β€œcorrupt history file” in zsh
# move to home directory
cd ~

# move the .zsh_history file into another .zsh_history_bad file
mv .zsh_history .zsh_history_bad

# write all printable strings into a new .zsh_history file
strings .zsh_history_bad > .zsh_history
@justjanne
justjanne / Price Breakdown.md
Last active April 5, 2025 08:10 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price