Skip to content

Instantly share code, notes, and snippets.

View Marusyk's full-sized avatar
πŸ¦‡
Always be yourself, unless you can be Batman, then always be Batman

Roman Marusyk Marusyk

πŸ¦‡
Always be yourself, unless you can be Batman, then always be Batman
View GitHub Profile
@davidfowl
davidfowl / .NET6Migration.md
Last active April 11, 2025 11:12
.NET 6 ASP.NET Core Migration
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
@cmendible
cmendible / kubectl_ubuntu_wsl.sh
Created November 16, 2019 22:02
Install kubectl on ubuntu (WSL) and use kubectl config from Windows
#!/bin/bash
# Receives your Windows username as only parameter.
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
windowsUser=$1
@sasjo
sasjo / drain_jenkins.groovy
Last active October 31, 2024 08:21
Drain Jenkins build queue and stop all running jobs
Jenkins.instance.queue.items.findAll { !it.task.name.contains("Extenda") }.each {
println "Cancel ${it.task.name}"
Jenkins.instance.queue.cancel(it.task)
}
Jenkins.instance.items.each {
stopJobs(it)
}
def stopJobs(job) {
if (job in jenkins.branch.OrganizationFolder) {
// Git behaves well so no need to traverse it.
@fabriziomello
fabriziomello / gapless_sequence.sql
Last active July 22, 2024 07:01
Gapless sequence example in PostgreSQL
CREATE TABLE public.gapless_sequence (
sequence_schema TEXT,
sequence_name TEXT,
last_value BIGINT DEFAULT 0,
step INTEGER DEFAULT 1
);
ALTER TABLE public.gapless_sequence
ADD CONSTRAINT gapless_sequence_pk PRIMARY KEY (sequence_schema, sequence_name);
@roxlu
roxlu / RendezVousClient.cpp
Created May 25, 2016 19:34
STUN + RendezVous Server / Cliet
#include <poly/Log.h>
#include <RendezVousClient.h>
#include <RendezVousTypes.h>
namespace poly {
/* -------------------------------------------------------------- */
RendezVousClientSettings::RendezVousClientSettings()
:rv_port(0)