Skip to content

Instantly share code, notes, and snippets.

@nhalase
nhalase / CohortsNavigationScreen.kt
Last active January 10, 2020 06:53
Example of possible ListWidget bug/limitation in Moko Widgets.
import dev.icerock.moko.widgets.screen.NavigationScreen
import dev.icerock.moko.widgets.screen.ScreenFactory
import kotlin.reflect.KClass
class CohortsNavigationScreen(
screenFactory: ScreenFactory
) : NavigationScreen<CohortsScreen>(screenFactory), CohortsScreen.Parent, CohortScreen.Parent {
override val rootScreen: KClass<out CohortsScreen>
get() = CohortsScreen::class
@nhalase
nhalase / script.ps1
Created October 14, 2020 16:57
Environment Setup - Windows - PowerShell - Allow AllSigned Scripts to execute without confirmation prompts
Set-ExecutionPolicy AllSigned -Scope CurrentUser -Force
# -ExecutionPolicy - Specifies the execution policy. If there are no Group Policies and each scope's execution policy is set to Undefined, then Restricted becomes the effective policy for all users.
## AllSigned - Requires that all scripts and configuration files are signed by a trusted publisher, including scripts written on the local computer.
# -Scope - Specifies the scope that is affected by an execution policy. The default scope is LocalMachine.
## CurrentUser - Affects only the current user.
# -Force - Suppresses all the confirmation prompts. Use caution with this parameter to avoid unexpected results.
@nhalase
nhalase / Hello.kt
Created August 19, 2021 14:38
Kotlin println example
println("Hello!")
@nhalase
nhalase / .gitignore-simple-starter
Last active August 31, 2021 15:40
VSCode, Vim, macOS, Linux, and Windows .gitignore Starter
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,vim,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,vim,visualstudiocode
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
@nhalase
nhalase / .gitignore-java-starter
Created August 31, 2021 15:49
VSCode, Vim, IntelliJ, Gradle, Maven, Java, macOS, Linux, and Windows .gitignore Starter
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,vim,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,vim,visualstudiocode
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
@nhalase
nhalase / .gitattributes-java-starter
Last active August 31, 2021 16:55
Java/Kotlin .gitattributes
# Common settings that generally should always be used with your language specific settings
# Auto detect text files and perform LF normalization
* text=auto
#
# The above will handle all files NOT found below
#
# Java sources
@nhalase
nhalase / .gitattributes-simple-starter
Created August 31, 2021 16:56
Simple .gitattributes Starter
# Common settings that generally should always be used with your language specific settings
# Auto detect text files and perform LF normalization
* text=auto
#
# The above will handle all files NOT found below
#
# Documents
@nhalase
nhalase / flyway-free.conf
Created September 10, 2021 15:05
The base Flyway 7.15.0 conf file with all Flyway Teams options removed
# Copyright © Red Gate Software Ltd 2010-2021
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@nhalase
nhalase / jsonb.kt
Created October 5, 2022 20:46
JSONB support (PostgreSQL)
import kotlinx.serialization.KSerializer
import kotlinx.serialization.json.Json
import kotlinx.serialization.serializer
import org.jetbrains.exposed.sql.Column
import org.jetbrains.exposed.sql.ColumnType
import org.jetbrains.exposed.sql.Table
import org.jetbrains.exposed.sql.statements.api.PreparedStatementApi
import org.postgresql.util.PGobject
inline fun <reified T : Any> Table.jsonb(
@nhalase
nhalase / game_goals.md
Created October 17, 2022 20:55
Game Goals

Progress

[X] - Elden Ring [X] - Horizon Zero Dawn [X] - Horizon Zero Dawn: The Frozen Wilds [X] - The Witcher 3 [X] - The Witcher 3: Hearts of Stone [X] - Yakuza 0 [X] - Yakuza Kiwami [X] - It Takes Two