Skip to content

Instantly share code, notes, and snippets.

View liebsterkamerad's full-sized avatar

Evgeny Klementyev liebsterkamerad

  • Albert Heijn Technology
  • Amsterdam
View GitHub Profile
@dlech
dlech / gelo.py
Last active September 19, 2023 07:40
A program for LEGO MINDSTORMS Robot Inventor - Gelo model
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 David Lechner <[email protected]>
# A program for LEGO MINDSTORMS Robot Inventor - Gelo
# Developed using MINDSTORMS App v1.3.4 (10.1.0), hub firmware v1.2.01.0103
# Building instructions: https://www.lego.com/cdn/product-assets/product.bi.additional.main.pdf/51515_Gelo.pdf
# Hub API: https://lego.github.io/MINDSTORMS-Robot-Inventor-hub-API/
@danjac
danjac / docker-compose.yml
Created May 12, 2018 11:22
docker-compose for typical Django+VueJS+PostgreSQL project
version: '2'
services:
db:
image: postgres
redis:
image: redis
@vi6six
vi6six / Java 8 streams
Last active January 23, 2024 18:17
Java 8 streams Map of maps transformation
private static void checkTreesForMissingDefinitions(Map<String, String> glossary) {
FinancialTrees.getTrees(false).values().stream() // Map<IndustryTemplate, Map<FinancialGroup, FinancialTree>>
.map(Map::values) // Stream<Collection<FinancialTree>>
.flatMap(Collection::stream) // Stream<FinancialTree>
.map(FinancialTree::getAllChildren) // Stream<List<FinancialTreeNode>> Get nodes fron tree as a List<Node>
.flatMap(List::stream) // Stream<FinancialTreeNode>
.map(FinancialTreeNode::getField) // Stream<FinField>
.distinct() // remove duplicated fields
.filter(Objects::nonNull) // remove null objects
@nicerobot
nicerobot / wait-for-postgres.sh
Created June 27, 2017 14:30
A better wait-for-postgres.sh
#!/bin/bash -e
# wait-for-postgres.sh
# Adapted from https://docs.docker.com/compose/startup-order/
# Expects the necessary PG* variables.
until psql -c '\l'; do
echo >&2 "$(date +%Y%m%dt%H%M%S) Postgres is unavailable - sleeping"
sleep 1
done
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@0xadada
0xadada / README.md
Last active August 5, 2022 16:48
VIM movement, keyboard commands and shortcuts