Skip to content

Instantly share code, notes, and snippets.

View muesli's full-sized avatar

Christian Muehlhaeuser muesli

View GitHub Profile
@kachayev
kachayev / concurrency-in-go.md
Last active May 4, 2025 05:48
Channels Are Not Enough or Why Pipelining Is Not That Easy
@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@jonmcclung
jonmcclung / Toast.qml
Last active July 19, 2024 14:10
Toast in QML. This implementation creates black toast with white text that appears at the bottom of the screen. It also supports adding multiple toast at a time using ToastManager with the newest toast at the bottom.
import QtQuick 2.0
/**
* adapted from StackOverflow:
* http://stackoverflow.com/questions/26879266/make-toast-in-android-by-qml
*/
/**
* @brief An Android-like timed message text in a box that self-destroys when finished if desired
*/
This work, excluding the Arch Linux logo, is made available under CC0: https://creativecommons.org/publicdomain/zero/1.0/
@ageis
ageis / YubiKey-GPG-SSH-guide.md
Last active April 10, 2025 08:49
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.

@posener
posener / go-shebang-story.md
Last active May 3, 2025 22:42
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@fm3
fm3 / ff57-tabs-mousewheel.js
Last active June 13, 2018 07:13 — forked from benoitryder/ff57-tabs-mousewheel.js
Change tabs with mousewheel in Firefox 58
/* To enable changing tabs by using the mouse wheel,
* enter this code into the browser console (Ctrl+Shift+J) */
var onTabWheel = function(ev) {
if (ev.deltaMode == 1 /* DOM_DELTA_LINE */) {
var idx = gBrowser.tabContainer.getIndexOfItem(gBrowser.selectedTab);
var direction = ev.deltaY > 0 ? 1 : -1;
gBrowser.selectTabAtIndex((idx + direction) % gBrowser.tabs.length);
}
}
@rivo
rivo / postgres.go
Last active July 7, 2024 14:28
A demo Go application (a PostgreSQL database browser) highlighting the use of the rivo/tview package. See https://github.com/rivo/tview/wiki/Postgres
package main
import (
"database/sql"
"fmt"
"net/url"
"os"
"reflect"
"regexp"
"strconv"
#!/bin/sh
set -x
# adb shell pm list packages -d
# adb shell pm list packages
adb shell pm uninstall -k --user 0 com.sonymobile.entrance
adb shell pm uninstall -k --user 0 com.sonymobile.xperiatransfermobile
adb shell pm uninstall -k --user 0 com.sonymobile.phoneusage
adb shell pm uninstall -k --user 0 com.sonymobile.googleanalyticsproxy
@miguelmota
miguelmota / rsa_util.go
Last active April 11, 2025 12:33
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)