Skip to content

Instantly share code, notes, and snippets.

View OlegGorj's full-sized avatar
🎯
Focusing

oleggorj OlegGorj

🎯
Focusing
View GitHub Profile
@OlegGorj
OlegGorj / skip_list.java
Created November 5, 2023 19:29
SkipList in java
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Random;
/**
* A skip list is a data structure that allows fast search within
* an ordered sequence of elements. Fast search is made possible
* by maintaining a linked hierarchy of subsequences, with each
* successive subsequence skipping over fewer elements than the
* previous one. Searching starts in the sparsest subsequence until
@OlegGorj
OlegGorj / gist:03ceac13a856094cd15f5494ded367c0
Created June 9, 2022 08:39 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
Example 1
===============================
Maps are a way to create variables that are lookup tables. An example will show this best. Let's extract our AMIs into a map and add support for the us-west-2 region as well:
variable "amis" {
type = "map"
default = {
"us-east-1" = "ami-b374d5a5"
"us-west-2" = "ami-4b32be2b"
}
@OlegGorj
OlegGorj / slack.sh
Created April 24, 2020 16:57 — forked from andkirby/slack.sh
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
package main
import (
"strings"
)
func main() {
strings.HasSuffix("foobar", "bar") // true
}

Clones all repods from the Org

curl -u <Personal Token>:x-oauth-basic 'https://api.github.com/orgs/<ORG>/repos?per_page=100' | jq '.[].ssh_url' -r | while read url; do git clone "$url"; done
Create Empty File

package main

import (
    "log"
    "os"
)
@OlegGorj
OlegGorj / ConfluentKafkaProducerHangsOnFlush.cs
Created October 21, 2019 19:59 — forked from blachniet/ConfluentKafkaProducerHangsOnFlush.cs
The Confluent.Kafka C# producer hangs indefinitely when the target partition has no leader. See https://github.com/confluentinc/confluent-kafka-dotnet/issues/1027
using System;
using System.Threading.Tasks;
using Confluent.Kafka;
namespace my_producer
{
class Program
{
static void Main(string[] args)
{

Diving into Kubernetes MutatingAdmissionWebhook

Admission controllers are powerful tools for intercepting requests to the Kubernetes API server prior to persistence of the object. However, they are not very flexible due to the requirement that they are compiled into binary into kube-apiserver and configured by the cluster administrator. Starting in Kubernetes 1.7, Initializers and External Admission Webhooks are introduced to address this limitation. In Kubernetes 1.9, Initializers stays in alpha phase while External Admission Webhooks have been promoted to beta and split into MutatingAdmissionWebhook and [ValidatingAdmissionWebhook](https://kubernetes