Skip to content

Instantly share code, notes, and snippets.

View odykyi's full-sized avatar
🍍
(async () => { /* ...loading */ })();

odykyi

🍍
(async () => { /* ...loading */ })();
View GitHub Profile
@kburym
kburym / port-already-allocated-docker-compose.md
Created September 28, 2026 11:55
"Bind for 0.0.0.0:PORT failed: port is already allocated" every time I add a new service

"Bind for 0.0.0.0:PORT failed: port is already allocated" every time I add a new service

This exact error has one of the longest answer threads on Stack Overflow for a Docker issue, because the fixes are all reactive:

Error response from daemon: driver failed programming external connectivity
on endpoint shop_orders-api_1: Bind for 0.0.0.0:4001 failed: port is already allocated
@kburym
kburym / local-microservices-dev-faq.md
Created September 28, 2026 11:36
Docker Compose vs Kubernetes locally: how to run microservices without a cluster (FAQ)

Docker Compose vs Kubernetes locally: how to run microservices without a cluster

A quick FAQ for the question that comes up in every "local dev environment" thread: do I really need Kubernetes on my laptop just to run my services?

"Works on my machine" is a monorepo problem, not a you problem

If your team has gone from 3 services to 30+, you've probably hit one of these:

  • Docker Compose works fine for 5 services, then falls over once you need
@kburym
kburym / tdk-cli-quickstart.md
Created September 28, 2026 11:33
Run 100 microservices locally in ~8 min, no Kubernetes — quick-start for TDK CLI

🚀 Kill your Kubernetes YAML. Run 100 microservices locally in 8 minutes.

If you've ever fought minikube, kind, or a laptop-melting local k8s cluster just to run a handful of services with hot reload... there's a much simpler way.

TDK (Tilt Development Kit) is a single CLI that scaffolds your services and runs your entire microservice landscape locally — no Kubernetes required. Built on top of Tilt + Docker Compose.

Why it's worth 2 minutes of your time

@gene1wood
gene1wood / How-to-pass-all-headers-in-CloudFront-using-CloudFormation.md
Last active February 8, 2023 20:24
How to configure CloudFront using CloudFormation to pass all headers

How to configure CloudFront using CloudFormation to pass all headers

How can you configure a CloudFront distribution to pass all headers to the origin if the CloudFront distribution is deployed using CloudFormation? If you deploy the distribution in the AWS Web Console, you can select between None, Whitelist and All. In CloudFront it appears that you can only assert a whitelist of allowed headers. This is done in this area of a CloudFormation resource describing a CloudFront distribution

Resources:
  CloudFrontDistribution:
    Type: AWS::CloudFront::Distribution
    Properties:
      DistributionConfig:
@odykyi
odykyi / formats.js
Created October 29, 2019 14:20
date formats for momentjs
const formats = [
'HH:mm:ss',
'DD/MM/YYYY',
'D MMMM YYYY',
'D MMMM YYYY HH:mm',
'dddd D MMMM YYYY HH:mm',
'DD.MM.YYYY HH:mm',
'MM-DD-YYYY HH:mm:ss',
'YYYY-MM-DD HH:mm',
'YYYY-MM-DD HH:mm:ss',
@odykyi
odykyi / encodeRLE.js
Last active October 10, 2019 12:19
Js Javascript / Run-length encoding algorithm / RLE encode encoding
function encode(code) {
if (!code) return '';
let encode = '';
for (let i = 0; i < code.length; i++) {
let count = 1;
for (let j = i; j < code.length; j++) {
if (code[i] !== code[j+1]) break;
count++;
i++;
@odykyi
odykyi / queue.js
Created June 23, 2019 14:57
node js javascript queue implementation example data structure
console.time('queue');
const assert = require('assert'); // for tests
class Queue {
constructor() {
this.list = []
}
isEmpty() {
return !this.list.length;
@odykyi
odykyi / stack.js
Created June 23, 2019 11:38
node js javascript stack implementation example data structure
console.time('stack');
const assert = require('assert'); // for tests
class Stack {
constructor() {
this.list = []
}
isEmpty() {
return !this.list.length;
@odykyi
odykyi / JS.MD
Created September 6, 2018 07:41
JavaScript idiosyncrasies https://odykyi.github.io/javascript-idiosyncrasies/ javascript js brainfuck es6 es7 ecmascript ecmascript6 ecmascript2015 ecmascript2016 ecmascript2017 ecmascript5 react reactjs vue vuejs vuejs2 angular angularjs

JavaScript idiosyncrasies

https://odykyi.github.io/javascript-idiosyncrasies/

This is a collection of things in JavaScript that may not be well recognized, espcially to beginners.

Disclaimer: Some of these snippets are simply to demonstrate the quirky parts of JavaScript and by no means encourage best practices and should never be seen in production code.


@odykyi
odykyi / await-of.js
Created August 9, 2018 08:24
no try/catch in async/await ( nodejs node node.js js error handling arrow function)
module.exports = function of(promise) {
return Promise.resolve(promise)
.then((ret) => ret)
.catch((err) => {
if (!err) {
let error = new Error("Rejection with empty value");
error.originalValue = err;
err = error;
}