Skip to content

Instantly share code, notes, and snippets.

View iscander's full-sized avatar

Oleksandr Ohurtsov iscander

  • Mykolaiv, Ukraine
View GitHub Profile
@iscander
iscander / keys-and-jwts.go
Created November 21, 2024 13:06 — forked from sam-w/keys-and-jwts.go
Golang RSA Keys and JWTs
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"time"
"gopkg.in/square/go-jose.v2"
@iscander
iscander / 1-setup.md
Created August 3, 2021 12:35 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

@iscander
iscander / Fail with a race detection.
Created July 2, 2021 13:59
go-sse data-race condition example
$ go test -race
2021/07/02 16:58:04 server started.
2021/07/02 16:58:04 channel 'siner' created.
2021/07/02 16:58:04 new client connected to channel 'siner'.
2021/07/02 16:58:04 message sent to channel 'siner'.
2021/07/02 16:58:04 message sent to channel 'siner'.
2021/07/02 16:58:04 message sent to channel 'siner'.
2021/07/02 16:58:04 message sent to channel 'siner'.
2021/07/02 16:58:04 message sent to channel 'siner'.
2021/07/02 16:58:04 message sent to channel 'siner'.
require 'redis'
require 'thread'
# Redis DataBase interface to save collected statistic
# new object apply any of the following parameters if needed:
# :host if you need to connect to an external host instead of the default 127.0.0.1
# :port if you need to use something other than Redis' default port of 6379
# :password if you configured Redis to require a password on connection
# :db if you want to select one of the multiple configured databases, other
# than the default of 0 (databases are identified by a zero-based index)