Skip to content

Instantly share code, notes, and snippets.

@jsoberg
jsoberg / AndroidGradleProjectExtensions.kt
Last active January 22, 2024 16:18
Gradle Android/Kotlin Project extensions
import com.android.build.gradle.BaseExtension
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.ExtensionContainer
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
/** Opens a block for configuring the Android extension for this Project. */
fun Project.android(configure: BaseExtension.() -> Unit) {
@wilmardo
wilmardo / .php-cs.dist.php
Last active April 6, 2021 20:35
PHP-CS-Fixer matching the Laravel StyleCI rules. The order of rules is the same as here: https://docs.styleci.io/presets#laravel. The linecount of the rules is exactly the same (110 without risky).
<?php
# source: https://docs.styleci.io/presets#laravel
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'align_multiline_comment' => true,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
@arcezd
arcezd / guide.raspbian.root.lvm.md
Last active March 18, 2024 23:15
Guide to move root Raspbian to LVM partition

Prepare the installation with LVM drivers

DISCLAIMER: Copied from [https://raspberrypi.stackexchange.com/questions/85958/easy-backups-and-snapshots-of-a-running-system-with-lvm/85959]

Moving the installation isn't the problem but the LVM drivers must be loaded on boot up so the root partition can be mounted and used for booting. Fortunately the Raspberry Pi supports loading a ramdisk for initrd so we have to do an additional step to create the initram containing drivers for LVM.

The following is only for a quick setup an initramfs where you have to monitor kernel updates by yourself. To use a more automated setup an initramfs you can look at How can I use an init ramdisk (initramfs) on boot up Raspberry Pi?.

If you are unexperienced with linux please try it first with a new image how I did for this How To. You can loose all data.

For reference I use Raspbian Buster with Desktop 2020-02-13, flashed it to a SD Card and boot it in a RasPi. First do an upgrade to get the latest software versions and instal

@donno
donno / fetch_vcdist.py
Last active January 25, 2024 19:45
Downloads and extract the Visual C++ Redistributables.
"""Downloads and extract the Visual C++ Redistributables.
This is useful when working with minidump files as the user may be running
with a new different version of the runtime. This script aims to maintain
a copy of the various versions.
Versions are normally added once I encounter them, in November 2022, I added
a rather large back catalogue of versions.
This requires dark.exe from Wix (http://wixtoolset.org/releases/) and
@enricofoltran
enricofoltran / main.go
Last active March 23, 2024 16:41
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@tomysmile
tomysmile / Raspberry and Gammu.md
Last active May 18, 2022 01:02 — forked from damonsk/gist:3955099
GAMMU: Send SMS with Raspberry Pi

Send SMS messages using Raspberry Pi.

Using gammu and Huawei E220

Prepare SD card with wheezy.

Login / complete rasp-config / reboot / login

Set vimrc to prevent annoying ADBC arrow keys

cp /etc/vim/vimrc ~/.vimrc