Skip to content

Instantly share code, notes, and snippets.

View alexrios's full-sized avatar
🦎
Zigging around

Alex Rios alexrios

🦎
Zigging around
View GitHub Profile
@alexrios
alexrios / utf-8-test.txt
Created November 3, 2020 12:42
UTF-8 stress test (thanks Markus Kuhn)
UTF-8 decoder capability and stress test
----------------------------------------
Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> - 2015-08-28 - CC BY 4.0
This test file can help you examine, how your UTF-8 decoder handles
various types of correct, malformed, or otherwise interesting UTF-8
sequences. This file is not meant to be a conformance test. It does
not prescribe any particular outcome. Therefore, there is no way to
"pass" or "fail" this test file, even though the text does suggest a
@alexrios
alexrios / main.go
Created September 13, 2020 01:28
Rate limiting with redis
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/go-redis/redis/v8"
"github.com/go-redis/redis_rate/v9"
@alexrios
alexrios / main.go
Created August 20, 2020 21:12
Formatting json.Marshall() using time.Time
package main
import (
"encoding/json"
"fmt"
"time"
)
type JSONTime time.Time
@alexrios
alexrios / main.go
Created August 20, 2020 17:48
GCP PubSub ~emulator~ client.
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"time"
@alexrios
alexrios / crypto-wrong-answers.md
Created June 24, 2020 10:36 — forked from paragonie-scott/crypto-wrong-answers.md
An Open Letter to Developers Everywhere (About Cryptography)
@alexrios
alexrios / pipeline2.kt
Created January 12, 2020 21:27
Using pipeline pattern with Kotlin channels
package app
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.channels.consumeEach
import kotlinx.coroutines.channels.produce
import kotlinx.coroutines.runBlocking
fun main() = runBlocking {
@alexrios
alexrios / pipeline.kt
Created January 12, 2020 21:05
Using pipeline pattern with Kotlin channels
package app
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.consumeEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
fun main() = runBlocking {
@alexrios
alexrios / repo-privado-gomod.md
Created December 21, 2019 03:46
Usando repositorios privados com Go Modules

1 - Configurar GIT (~/.gitconfig)

[url "ssh://[email protected]/"]
	insteadOf = https://github.com/

2 - Evitar a checagem do SUMDB

go env -w GONOSUMDB="github.com/<org>/<project>"
package main
import (
"fmt"
"time"
)
func BatchStrings(values <-chan string, maxItems int, maxTimeout time.Duration) chan []string {
batches := make(chan []string)
@alexrios
alexrios / arch-QC35-ii.txt
Last active July 13, 2021 13:50
In order to work the Bose QC35 II Headset Bluetooth do the following
- sudo pacman -Syu pulseaudio-alsa pulseaudio-bluetooth bluez bluez-libs bluez-utils
- turn off bluetooth from your computer
- sudo btmgmt ssp of
- gpasswd -a $USER lp
- pin is always `0000`
FAQ
1 - I only hear the "call from" message
Confirm that by switching the mode from HSP/HFP to `A2DP Sink` solve the problem.
- systemctl restart bluetooth