Skip to content

Instantly share code, notes, and snippets.

View ulexxander's full-sized avatar
💪
Workin hard

Alexander Ustyugov ulexxander

💪
Workin hard
  • Limitlex d.o.o.
  • Slovenia
View GitHub Profile
@ulexxander
ulexxander / client-libraries.md
Created March 9, 2022 13:43
Simple and obvious approach for estabilishing end-to-end typing between communicating services with better maintainability and productivity.

image

Made using https://app.diagrams.net

<mxfile host="app.diagrams.net" modified="2022-03-09T13:38:35.242Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36" etag="AHwkt2RR6Z7wHRqwMwQm" version="16.6.5" type="device"><diagram id="H_dx995EEjTLIg52hnT0" name="Page-1">5Vpbc5s4FP41nkkf6uHi2z7Gdpp0Jtub03b3aUcGGbQBxAoRx/31e44QYAKkTmqbOJ2JJ+jogvSdT5+OhHr2LLy/FCT2/+QuDXqW4d737HnPsixjZME/tGwyi2mOBpnFE8zVttKwYD+oNhramjKXJpWCkvNAsrhqdHgUUUdWbEQIvq4WW/Gg+taYeLRmWDgkqFu/M1f6+TAMo8y4oszz81eP85yQ5KW1IfGJy9dbJvuiZ88E5zJ7Cu9nNED4cmCyeu9acoueCRrJXSq8N4fix8er2yQxPs4W39a3i+/Lt8OslTsSpHrEs4Bhg5ZxzZaCiI3uvNzkkCRrFgYkgtRUV6ZC0vvWXpnFWIEmlIdUYqOGrjDI8dIMGQx0el3CbU20zd9CujAS7WKvaLsEAR40Dk/AxBzUQJGbmIJlRmQNjrXPJF3ExMH0GqYB4OLLEN44N+GRJHHGyxW7p+6umLX7qhVI6wGOdRhHDSiODgbipA3EOfdOBURz1DGKg0ENKuqCQOkkF9LnHo9IcFFap4KnkYswzQ1IlWWuOY81oP9SKTdabUkqeRXuFY/kOxKyAGG4os
package main
import (
"strconv"
"time"
)
func main() {
intsChan := make(chan int)
stringsChan := make(chan string)
@ulexxander
ulexxander / google-auth.ts
Created May 15, 2022 09:55
Google Auth getAccessToken using keyFile
const googleAuth = new GoogleAuth({
keyFile: "./google-service-account.json",
scopes: "https://www.googleapis.com/auth/homegraph",
});
const accessToken = await googleAuth.getAccessToken();
console.log(accessToken);
@ulexxander
ulexxander / subjects.go
Created May 31, 2022 06:56
Good way to organize Pub/Sub subjects for both publishers and consumers. Can be applied to other OOP languages as well.
package api
import "fmt"
func publish(subject string) {
fmt.Println("Publishing on", subject)
}
func subscribe(subject string) {
fmt.Println("Subscribing on", subject)
@ulexxander
ulexxander / env.go
Created June 23, 2022 18:58
Simple Go environment variables parsing
type env struct {
logLevel string
httpAddr string
natsURL string
mongoURI string
mongoDatabase string
stripeAPIKey string
stripeWebhookSigningSecret string
stripeOpenWeatherSubscriptionPriceID string
stripeRedirectsURL string
@ulexxander
ulexxander / assertions.go
Created June 28, 2022 10:26
Go decimal.Decimal equality tests assertion workaround - UnscaleDecimals.
package requirex
import (
"testing"
"github.com/stretchr/testify/require"
)
// Equal wraps require.Equal and adds unscaling of decimal.Decimal values.
// It prevents tests from failing if expected and actual decimal.Decimal values
@ulexxander
ulexxander / cv.md
Last active April 14, 2025 14:22
My CV on January 2025.

CV January 2025

Fullstack developer, DevOps, system administrator with 4 years of experience working in fintech blockchain oriented company and 3 years of experience working in IoT oriented startup.

@ulexxander
ulexxander / vscode.nemo_action
Created October 17, 2022 15:50
Nemo file manager (Linux Mint) action for VSCode (appears in context menu)
[Nemo Action]
Name=Open in VSCode
Comment=Open in VSCode
Exec=code %F
Icon-Name=window-new
Selection=Any
Extensions=dir;exe;dll;zip;gz;7z;rar;
@ulexxander
ulexxander / docker-compose.yml
Created December 4, 2022 10:08
EFK log collection stack (Elasticsearch, Fluent Bit, Kibana) setup for development.
version: "3.8"
services:
elasticsearch:
image: elasticsearch:8.5.2
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
environment:
- ES_JAVA_OPTS=-Xms512m -Xmx512m
- discovery.type=single-node
@ulexxander
ulexxander / user-data.yml
Created December 21, 2022 20:32
Cloud Init config that setups user, temporary password, SSH server settings, Docker and Node Exporter
#cloud-config
users:
- name: alex
groups: sudo, docker
shell: /bin/bash
lock_passwd: false
ssh_authorized_keys:
- ssh-ed25519 ???