<div id="comments-section" data-bsky-uri="{{ .Params.bsky }}"></div>
{{ $comments := resources.Get "js/comments.js" }}
<script src="{{ $comments.RelPermalink }}"></script>
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
| void main() { | |
| var s = """ | |
| void main() { | |
| var s = %c%c%c | |
| %s%c%c%c; | |
| IO.print(String.format(s, 34, 34, 34, s, 34, 34, 34)); | |
| }"""; | |
| IO.print(String.format(s, 34, 34, 34, s, 34, 34, 34)); | |
| } |
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
| //> using scala 3.7.3 | |
| //> using dep com.softwaremill.ox::core:1.0.0 | |
| import scala.concurrent.duration.* | |
| import java.time.Instant | |
| import ox.* | |
| import scala.util.boundary | |
| import java.util.ArrayList | |
| import java.util.concurrent.locks.LockSupport |
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
| package org.jetbrains.demo | |
| import io.ktor.server.application.* | |
| import io.ktor.server.engine.* | |
| import io.ktor.server.netty.* | |
| import io.ktor.server.response.* | |
| import io.ktor.server.routing.* | |
| fun main() { | |
| embeddedServer(Netty, configure = { |
Kotlin/Native requires that C libraries are compiled with a specific verison of GCC.
You can use the GCC used by Kotlin/Native itself. These Gradle tasks will help with this.
// build.gradle.kts
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
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
| addEventListener("fetch", e => { | |
| if (e.request.destination !== "image" || // Only do this when requesting an image | |
| request.mode === "no-cors") // We don't know the status of no-cors images | |
| return; | |
| e.respondWith((async () => { | |
| try { | |
| const response = await fetch(e.request); | |
| if (response.ok) | |
| return response; |
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
| import org.jetbrains.compose.compose | |
| import org.jetbrains.compose.desktop.application.dsl.TargetFormat | |
| buildscript { | |
| dependencies { | |
| classpath("com.guardsquare:proguard-gradle:7.2.1") | |
| } | |
| } | |
| repositories { |
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
| import RickRoll.writer | |
| object RickRoll { var writer: (String) -> Unit = { println(it) } } | |
| val Never = RickAstleyNever // to get different highlighting color | |
| object RickAstleyNever { | |
| infix fun gonna(x: give) = give | |
| infix fun gonna(x: let) = let | |
| infix fun gonna(x: run) = run | |
| infix fun gonna(x: make) = make | |
| infix fun gonna(x: say) = say |
var s=%1$s%2$s%1$s;printf(s,(char)34,s);/exit";printf(s,(char)34,s);/exitNewerOlder