Add this file to your AI assistant's system prompt or context to help it avoid common AI writing patterns. Source: tropes.fyi by ossama.is
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
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
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 { |
NewerOlder