Skip to content

Instantly share code, notes, and snippets.

View dgierejkiewicz's full-sized avatar

Dariusz Gierejkiewicz dgierejkiewicz

View GitHub Profile
package config
// Configurations exported
type Configurations struct {
Server ServerConfigurations
Database DatabaseConfigurations
EXAMPLE_PATH string
EXAMPLE_VAR string
}
@jsdevtom
jsdevtom / frontend-ws-connection.ts
Last active July 26, 2024 16:21
kubernetes-ingress websockets with nodejs
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`);
export const wsObserver = ws
.pipe(
retryWhen(errors =>
errors.pipe(
delay(1000)
)
)
);
#!/bin/bash
 set -e
 SECRETS_MANAGER="aws secretsmanager"
 REGION="ap-southeast-1"
 
 function get_secret {
$($SECRETS_MANAGER get-secret-value --secret-id $secret --query SecretString --output text --region $REGION)
 }
 
 function parse_secret {
@CROSP
CROSP / docker-compose.yml
Created February 7, 2019 00:17
Kafka Manager Auto Cluster Creation
version: '3.1'
services:
zookeeper:
image: zookeeper:3.4
volumes:
- "./zookeeper/data:/data"
- "./zookeeper/logs:/datalog"
ports:
- "2181:2181"
@miguelmota
miguelmota / send.sh
Created January 16, 2019 06:19
Golang UDP server example
echo 'hello world' > /dev/udp/0.0.0.0/3000
@darbyluv2code
darbyluv2code / MyLoggerConfig.java
Last active March 12, 2023 10:03
Spring Logging for Spring 5.1 - All Java Configuration
package com.luv2code.springdemo;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
@tomekbielaszewski
tomekbielaszewski / main.go
Last active August 17, 2023 19:22
Example of RabbitMQ reconnect feature. Including recovering already registered consumers.
package main
import (
"fmt"
"log"
"time"
)
func main() {
queue := NewQueue("amqp://guest:guest@localhost:5672/", "hello")
@grantjenks
grantjenks / bottlebench.py
Last active October 28, 2021 18:00
Server-side I/O Performance in Python
"""Server-side I/O Performance in Python
Based on the article and discussion at:
https://www.toptal.com/back-end/server-side-io-performance-node-php-java-go
The code was posted at:
https://peabody.io/post/server-env-benchmarks/
node {
try{
notifyBuild('STARTED')
bitbucketStatusNotify(buildState: 'INPROGRESS')
ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/") {
withEnv(["GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"]) {
env.PATH="${GOPATH}/bin:$PATH"
stage('Checkout'){
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active July 25, 2024 08:22
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in