Skip to content

Instantly share code, notes, and snippets.

@thalesmg
thalesmg / use-password-store-with-forge.org
Created January 28, 2025 16:59 — forked from timstott/use-password-store-with-forge.org
Use password-store (aka pass) with forge and github-review

Use password-store (aka pass) with forge and github-review

We can use pass as an emacs auth-source backend to access credentials.

Add auth-source-pass (included with emacs 26) to your emacs config:

(require 'auth-source-pass)
(auth-source-pass-enable)

This prepends password-store to the variable auth-sources.

@thalesmg
thalesmg / ghretry.sh
Last active February 7, 2025 19:44
github actions retry
#!/usr/bin/env bash
set -exuo pipefail
BRANCH=$1
GITHUB_REPO=emqx/emqx
function infer_home_repo() {
local branch="$1"
IFS=":" read -ra REF <<< "$branch"
if [[ "${#REF[@]}" -eq 2 ]]; then
@thalesmg
thalesmg / retag.sh
Last active June 27, 2024 13:42
retag script
#!/usr/bin/env bash
set -exuo pipefail
if [[ $# -lt 3 ]]; then
echo "usage: $0 TAG REMOTE BRANCH"
return 1
fi
tag="$1"
@thalesmg
thalesmg / gh-actions-order.css
Created January 27, 2024 21:01
github actions sort checks order
/* ==UserStyle==
@name github.com - Jan 2024
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author Me
==/UserStyle== */
@-moz-document domain("github.com") {
/* in firefox you may need to set layout.css.has-selector.enabled to true in order for this to work */
@thalesmg
thalesmg / erlang-java-interop-demo.sh
Created June 28, 2023 12:44 — forked from eriksoe/erlang-java-interop-demo.sh
An Erlang-Java Interop Demo - executable summary
#!/bin/bash -x
#######################################################################
#
# Demo of Erlang IDL, as applied to property testing of Java code.
# We'll need Triq.
git clone git://github.com/krestenkrab/triq.git
(cd triq && ./rebar compile)
ERL_ROOT=`erl -noshell -eval 'io:format("~s\n", [code:root_dir()]), init:stop().'`
@thalesmg
thalesmg / person.proto
Last active May 24, 2023 14:10
Example of how to use Schema Registry + Rule Engine in EMQX 5.0 (protobuf, encoding)
// Generate `person_pb2.py` by running `protoc --python_out=. person.proto` before
// running `protobuf_mqtt.py`
syntax = "proto2";
package tutorial;
message Person {
required string name = 1;
required int32 id = 2;
@thalesmg
thalesmg / avro_mqtt_sub.py
Created May 23, 2023 20:09
Example of how to use Schema Registry + Rule Engine in EMQX 5.0 (avro, encoding)
# Original source: https://github.com/terry-xiaoyu/schema-registry-examples/blob/master/avro/avro_mqtt.py
import paho.mqtt.client as mqtt
import io
import json
import avro.schema
import avro.datafile
import avro.io
import avro.ipc
import time
@thalesmg
thalesmg / person.proto
Created May 22, 2023 14:23
Example of how to use Schema Registry + Rule Engine in EMQX 5.0 (protobuf)
// Generate `person_pb2.py` by running `protoc --python_out=. person.proto` before
// running `protobuf_mqtt.py`
syntax = "proto2";
package tutorial;
message Person {
required string name = 1;
required int32 id = 2;
@thalesmg
thalesmg / avro_mqtt.py
Last active May 22, 2023 14:21
Example of how to use Schema Registry + Rule Engine in EMQX 5.0 (avro)
# Original source: https://github.com/terry-xiaoyu/schema-registry-examples/blob/master/avro/avro_mqtt.py
import paho.mqtt.client as mqtt
import io
import json
import avro.schema
import avro.datafile
import avro.io
import avro.ipc
import time
@thalesmg
thalesmg / latest_stack.sh
Created October 20, 2022 21:01
Find latest avaiable Haskell Stack snapshot (LTS)
stack ls snapshots -l remote | rg -o 'lts-[0-9]+\.[0-9]+' | sort -rn | head -n1
stack ls snapshots -l remote | grep -Eo 'lts-[0-9]+\.[0-9]+' | sort -rn | head -n1