This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| internal class Database(uri: String, user: String, password: String) { | |
| private val driver = GraphDatabase.driver(uri, AuthTokens.basic(user, password)) | |
| val asyncSession: AsyncSession | |
| get() = driver.session(AsyncSession::class.java, SessionConfig.forDatabase("neo4j")) | |
| val session: Session | |
| get() = driver.session(SessionConfig.forDatabase("neo4j")) | |
| fun query(query: String, params: Map<String, Any> = emptyMap()): Flow<Record> = channelFlow { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set $lang "en"; | |
| if ( $http_accept_language ~ ^(..) ) { | |
| set $lang $1; | |
| } | |
| location / { | |
| if ($request_uri ~ ^/(.*).html) { | |
| return 302 /$1$is_args$args; | |
| } | |
| if ($request_uri !~ "^/[a-z]{2}/(.*)") { | |
| return 302 https://$host/$lang$request_uri; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private var destination: Point = player.pos.copy() | |
| private val playerSpeed = 6.0 | |
| private val step = 20 | |
| init { | |
| addUpdater { | |
| handeKeyboardControls() | |
| } | |
| addFixedUpdater(25.milliseconds) { | |
| if (destination.distanceTo(player.pos) > playerSpeed) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create = (properties = {}, children = [], attrs = {}) => children.reduce((e, curr) => (e.appendChild(curr), e), Object.entries(attrs).reduce((e, [k, v]) => (e.setAttribute(k, v), e), Object.assign(document.createElement(properties.tag), properties))); |