The Wayback Machine - https://web.archive.org/web/20211107021230/https://github.com/d1snin
Skip to content
Avatar
:shipit:
I may be slow to respond.
:shipit:
I may be slow to respond.

Organizations

@corby-dev
Block or Report

Block or report d1snin

Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
d1snin/README.md

@Bean
fun d1snin(): Human = developer {
    general {
        name = "Mikhail Koshkin"
        age = 15
    }

    knowledge {
        languages {
            language {
                name = "Kotlin"
                experienceYears = 0.5
            }

            language {
                name = "Java"
                experienceYears = 1.0
            }
        }

        frameworks {
            framework {
                name = "Spring Framework"
                modules = listOf(
                    "core",
                    "data",
                    "web",
                    "security",
                    "cloud"
                )
                experienceYears = 0.2
            }
        }
    }

    contacts {
        contact {
            service = "discord"
            address = "d1snin#3007"
        }

        contact {
            service = "e-mail"
            address = listOf("~", "@", "d1s.uno").joinToString()
        }

        contact {
            service = "slack-connect"
            address = "d1snin@aol.com"
        }

        contact {
            service = "telegram"
            address = "@d1snin"
        }
    }
}

@DslMarker
annotation class DeveloperDslMarker

@DeveloperDslMarker
open class Human {
    lateinit var name: String
    var age by Delegates.notNull<Int>()
}

@DeveloperDslMarker
open class Knowledge {
    lateinit var name: String
    var experienceYears by Delegates.notNull<Double>()
}

@DeveloperDslMarker
class Language : Knowledge()

@DeveloperDslMarker
class Framework : Knowledge() {
    lateinit var modules: List<String>
}

@DeveloperDslMarker
class LanguageContext(
    val dev: Developer
) {
    inline fun language(languageCtx: Language.() -> Unit) =
        this.dev.languages.add(Language().apply(languageCtx))
}

@DeveloperDslMarker
class FrameworkContext(
    val dev: Developer
) {
    inline fun framework(frameworkCtx: Framework.() -> Unit) =
        this.dev.frameworks.add(Framework().apply(frameworkCtx))
}

@DeveloperDslMarker
class KnowledgeContext(
    val dev: Developer
) {
    inline fun languages(languageCtx: LanguageContext.() -> Unit) =
        languageCtx(LanguageContext(dev))

    inline fun frameworks(frameworkCtx: FrameworkContext.() -> Unit) =
        frameworkCtx(FrameworkContext(dev))
}

@DeveloperDslMarker
class Contact {
    lateinit var service: String
    lateinit var address: String
}

@DeveloperDslMarker
class ContactContext(
    val dev: Developer
) {
    inline fun contact(contactCtx: Contact.() -> Unit) =
        dev.contacts.add(Contact().apply(contactCtx))
}

@DeveloperDslMarker
class Developer : Human() {
    val languages = mutableListOf<Language>()
    val frameworks = mutableListOf<Framework>()
    val contacts = mutableListOf<Contact>()

    companion object {
        inline fun developer(developerCtx: Developer.() -> Unit): Developer =
            Developer().apply(developerCtx)
    }

    inline fun general(humanCtx: Human.() -> Unit) =
        this.apply(humanCtx)

    inline fun knowledge(knowledgeCtx: KnowledgeContext.() -> Unit) =
        knowledgeCtx(KnowledgeContext(this))

    inline fun contacts(contactCtx: ContactContext.() -> Unit) =
        contactCtx(ContactContext(this))
}

/ I think I overdid it. /

wakatime

kotlin

Pinned Loading

  1. Lightweight discord bot that aims to log any events that occur in your discord server and to moderate it. Right now in active development.

    Kotlin 10 5

  2. An instance of a cloud storage system written in Java using Netty. Uses the TCP protocol to transfer data between the server and the client.

    Java 1

  3. Pulseq is a service for monitoring activity from all your devices.

    Kotlin 2

479 contributions in the last year

Nov Dec Jan Feb Mar Apr May Jun Jul Aug Sep Oct Mon Wed Fri

Contribution activity

November 2021

Created 1 repository

Created a pull request in technically-functional/heartbeat that received 1 comment

impr: Isolate Redis in the docker network

I'm using networks here, this will make redis inaccessible from the host, but accessible to the heartbeat app (inside 'heartbeat-net')

+8 −2 1 comment

Created an issue in d1snin-dev/pulseq that received 1 comment

Not using env vars at all

We can opt out of using environment variables and use a regular configuration file, simply because the docker image is not supplied from any regist…

1 comment