Skip to content

Instantly share code, notes, and snippets.

View MrModest's full-sized avatar

Kamil MrModest

View GitHub Profile
data class Playbook(
val name: String,
val hosts: Host[],
val remoteUser: User,
val varFiles: File[],
val vars: ObjectNode // need valitation so root will be only Map
val tasks: Task[]
)
sealed class ObjectNode {
@MrModest
MrModest / models.kt
Last active April 7, 2024 10:53
The model structure for potential trip planner app like 'tripit.com' or 'travelerbuddy.com'.
/*
The idea behind it to make something like 'TravelerBuddy', but simplier. Easy to write and easy to read.
Just to have a chronological plan of points of interests and all crucial parts of journey. Also, to have all crucial info handy.
Backend is as simple as a CRUD (if you aren't planned to implement multi-user/authorization support).
The most work is expected on Frondend side. It needs to provide a convenient and very specific form for each TripItem.
And also draw a "graph" like below.
No need to support autocompletion for Address. It's enought to support "open in Map" feature. So even no needs in having a build-in map view.
@MrModest
MrModest / anki-deutsch-nomen-template.html
Last active February 26, 2023 14:06
Template for Anki: German nouns - Deutsch Nomen
<!--
Fields: Übersetzung; Artikel; Nomen; Plural; Beispiel
-->
{{FrontSide}} <!-- {{Übersetzung}} -->
<hr id=answer>
<span class="{{Artikel}}"><b>{{Artikel}}</b> {{Nomen}}</span>
/*
Source: https://www.reddit.com/r/Anki/comments/ggt5uf/edits_to_nightmode_not_working_trying_to_change/
*/
html {
overflow: scroll;
overflow-x: hidden;
}
/* CONTAINER FOR YOUR CARDS */
#kard {

⚠️ WARNING! All the content below was generated by ChatGPT, so take it with a grain of sault.


Legend:

  • Global refers to the ease of relocating with the job internationally.
  • Salary refers to the expected salary for the job compared to the average salary in the region.
  • WLB refers to the work-life balance,
    • with Possible meaning that a normal 40-hour workweek is common
  • and Hardly possible meaning that overtime or unusual schedules are common.
@MrModest
MrModest / Umlauts_and_Eszett.json
Last active February 13, 2023 22:11
Karabiner Umlauts and Eszett config
{
"title": "German Umlaut",
"rules": [
{
"description": "Change option + a/o/u to ä/ö/ü",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "a",
@MrModest
MrModest / docker-compose.yml
Created September 11, 2021 19:23
Example docker-compose config
version: "3.9"
services:
db:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
using System;
namespace YourDomenName
{
public readonly struct Optional<TValue> where TValue : notnull
{
private readonly TValue? _value;
public static Optional<TValue> None { get; } = new (default, false);
@MrModest
MrModest / DictionaryWithCustomDefaultValue.cs
Last active May 31, 2018 15:46
Implementation for IDictionary with custom default value if key doesn't exist
//Author: John Sonmez | https://stackoverflow.com/users/45365 | https://github.com/jsonmez
//Source: https://stackoverflow.com/a/7061653/7422280
//GitHub: https://github.com/jsonmez/Defaultable-Dictionary
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace DefaultableDictionary
@MrModest
MrModest / UML.json
Last active November 27, 2017 18:19
[{
"Modifier": "publicMod",
"Name": "Angle",
"FullName": "Tetris.Angle",
"Namespace": "Tetris",
"BaseClass": null,
"Attributes": [{
"Modifier": "publicMod",
"IsConstant": false,
"IsStatic": false,