Skip to content

Instantly share code, notes, and snippets.

View sschuberth's full-sized avatar
:octocat:
Enjoying Kotlin since 2017!

Sebastian Schuberth sschuberth

:octocat:
Enjoying Kotlin since 2017!
View GitHub Profile
@Washi1337
Washi1337 / TinySharp.cs
Last active November 3, 2024 16:00
A program to emit a tiny .NET binary program printing Hello World to the standard output. Blog post: https://blog.washi.dev/posts/tinysharp/
using System.Text;
using AsmResolver;
using AsmResolver.DotNet;
using AsmResolver.DotNet.Builder.Metadata.Blob;
using AsmResolver.DotNet.Builder.Metadata.Strings;
using AsmResolver.DotNet.Code.Cil;
using AsmResolver.DotNet.Signatures;
using AsmResolver.IO;
using AsmResolver.PE;
using AsmResolver.PE.DotNet.Builder;
@h0tk3y
h0tk3y / kotlin-variant-aware-dependencies.md
Last active March 31, 2023 11:05
Kotlin Usages of Gradle Variant-Aware Dependency Management

Kotlin Usages of Gradle Variant-Aware Dependency Management

This document is up-to-date for Kotlin release: 1.3.30.

Here is the list of all attributes used by the Kotlin Gradle plugin. The details, configuration and possible values will be listed below.

Name Type
org.gradle.usage (owned by Gradle) org.gradle.api.attributes.Usage
@hopeseekr
hopeseekr / docker_dedicated_filesystem.md
Created February 3, 2018 04:01
Putting Docker on its own pseudo filesystem

Docker on BTRFS is very buggy and can result in a fully-unusable system, in that it will completely butcher the underlying BTRFS filesystem in such a way that it uses far more disk space than it needs and can get into a state where it cannot even delete any image, requiring one to take drastic actions up to and including reformatting the entire affected BTRFS root file system.

According to the official Docker documentation:

btrfs requires a dedicated block storage device such as a physical disk. This block device must be formatted for Btrfs and mounted into /var/lib/docker/.

In my experience, you will still run into issues even if you use a dedicated partition. No, it seems it requires a standalone

@chalstrick
chalstrick / testAllCheckoutSituations.sh
Created January 15, 2018 16:50
test all(?) combinations of content (even file<->dir), skipWorktree bits, sparse-checkout content during a git checkout
#!/bin/bash
#
# Sets up a lot of repos to test git-checkout operations. Setup test repos for all (?) possible
# combinations of contents in merge commit, index, workingtree and also for all combinations
# of skip-worktree bit and .git/info/sparse-checkout content
# After the repos are setup try to checkout and print status regarding worktree content, HEAD
#
# Requires that there is an executable 'jgit' in $PATH which is the command-line version
#
# usage: testAllCheckoutSituations.sh [-jgit]
PowerShell sample:
$token = "" # token from https://ci.appveyor.com/api-token
$accountName = "" # account name from project IRL (after project/")
$projectSlug = "" # project slug from project IRL (after account)
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
@jonico
jonico / evaluierungsfragen.md
Last active December 6, 2019 08:51
Evaluierungsfragen/kriterien bei der Auswahl einer Versionskontrollverwaltungs- / Social Coding-Plattform

Business Coding Platform Evaluierungskriterien / Fragen

  • Wie lange dauert es, einen neuen Entwickler in die Plattform einzuarbeiten? Welcher Trainingsaufwand ist erforderlich, bis der erste Commit in Produktion gehen kann?

  • Wie unterstützt die gewählte Plattform das Aufbauen eines unternehmensweiten Entwickler-Profils, aus dem die Entwicklungsaktivität, Popularität, Programmiersprachen und Tätigkeitsschwerpunkt (welche Repositories) eines Entwicklers oder Entwicklerteams hervorgeht?

  • Wie können Entwickler und Designer schnell und unproblematisch Quellcode-Snippets, Design-Überlegungen, Interview-Fragen und andere Markdown-Dokumente miteinander teilen? Besteht die Möglichkeit, diese Dokumente zu durchsuchen, insofern sie nicht geheim angelegt worden?

  • Wie können Nicht-Entwickler (Ingenieure, Fachabteilung, Projektleiter, Marketing, Legal), Änderungen an Design-Dokumenten und Dokumentation ohne Kommandozeilenwissen oder Desktop-Applikationen vorschlagen? Erlaubt die Web-Oberfläche das Hinzufügen, Lö

@kouk
kouk / How to add a submodule with shallow checkout and shallow clone
Last active April 17, 2024 20:16
.How to add a submodule with shallow checkout and shallow clone
If you have a huge repository (in size and in history) and want to add a subfolder
to your project as a submodule you can follow this example to save time and space
using git's shallow clone and shallow checkout feature. It is a bit more complicated
in this example because I assume that you want your submodule to track a non-default
branch, called `mybranch`, instead of the `master` branch. Things could probably get
a lot simpler when using the default branch. After following the commands in these
examples you can use `git submodule update` and `git submodule update --remote` as normal.
public class Dexter {
private static String optimizedDirectory = "optimized";
private static String workDirectory = "working";
public static void loadFromAssets(Context context, String fileName) throws Exception {
File optimized = new File(optimizedDirectory);
optimized = context.getDir(optimized.toString(), Context.MODE_PRIVATE);
optimized = new File(optimized, fileName);
#!/bin/bash
# Usage instructions at http://www.megaleecher.net/Best_Raspberry_Pi_Hot_Backup_Shell_Script
# This version disables backup image compression as it takes too much time on Pi, to enable uncomment the relavent lines
# Setting up directories, Just change SUBDIR and DIR varibales below to get going
SUBDIR=raspberrypi_backups
DIR=/media/ExternalHd/$SUBDIR
@andris9
andris9 / git-cache-meta.sh
Created March 5, 2012 13:15
git-cache-meta
#!/bin/sh -e
#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
# - save all files metadata not only from other users
# - save numeric uid and gid
# 2012-03-05 - added filetime, andris9