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
| document.querySelector('main > div > div > div').style.overflow = 'visible'; | |
| document.querySelector('main > div > div > div > div.scrollbar-view').style.overflow = 'visible'; |
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
| docker run --pid container:<target-docker-container-name> \ | |
| --network container:<target-docker-container-name> \ | |
| --rm \ | |
| --entrypoint "/opt/java/openjdk/bin/jcmd" \ | |
| --user 65532:65532 \ | |
| dockerproxy.aexp.com/eclipse-temurin:17 1 GC.heap_dump <some directory the target process can write to>/heap.hprof | |
| # jcmd is not writing the file, it is merely sending a request to the target process to write the heap dump, the target process needs read write perms the file argument: <some directory the target process can write to>/heap.hprof | |
| # 65532 is the user id of distroless/java :nonroot images |
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
| # GitHub does not let you push orphan branches. This is the next closest thing. (Null Commit, Empty Commit, Zero Commit) | |
| git config user.name "_" | |
| git config user.email "" | |
| git switch --orphan empty-branch | |
| GIT_AUTHOR_DATE="1970-01-01 00:00:00 +0000" GIT_COMMITTER_DATE="1970-01-01 00:00:00 +0000" git commit --allow-empty --allow-empty-message -m "" |
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
| ❯ ollama run deepseek-r1:32b | |
| >>> fibonacci sequence in Scala using LazyList.zip | |
| <think> | |
| Okay, so I need to figure out how to generate the Fibonacci sequence in Scala using LazyList.zip. Hmm, let me | |
| start by recalling what a Fibonacci sequence is. It's a series where each number is the sum of the two preceding | |
| ones, usually starting with 0 and 1. | |
| Now, I remember that in Scala, LazyList is similar to streams and allows for lazy evaluation, which is good for | |
| infinite sequences because it doesn't compute all elements upfront. So using LazyList makes sense here since the | |
| Fibonacci sequence can be infinitely long. |
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 com.gabrieljones | |
| /** | |
| * Represents a set of elements that may or may not exist | |
| * @tparam T the type of the elements in the set | |
| */ | |
| sealed trait ExiSet[T] { | |
| def exists(p: T => Boolean): Boolean | |
| } |
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 gabrieljones | |
| import com.google.common.math.BigIntegerMath | |
| import java.math.BigDecimal | |
| import java.math.BigInteger | |
| import java.math.MathContext | |
| import java.math.RoundingMode | |
| import kotlin.coroutines.cancellation.CancellationException | |
| fun main() { |
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
| inline fun <R> runCatchingNonFatal(block: () -> R): Result<R> { | |
| return try { | |
| Result.success(block()) | |
| } | |
| catch (t: Throwable) { | |
| when (t) { | |
| // VirtualMachineError includes OutOfMemoryError and other fatal errors | |
| is VirtualMachineError, is ThreadDeath, is InterruptedException, is LinkageError, is CancellationException -> throw t | |
| else -> Result.failure(t) |
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 com.gabrieljones | |
| import java.util.concurrent.{Executors, ScheduledFuture} | |
| import scala.sys.ShutdownHookThread | |
| object AllLogicInShutdownHook { | |
| def main(args: Array[String]): Unit = { | |
| // schedule executor | |
| println("Adding Hook...") |
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 com.gabrieljones | |
| import scala.collection.mutable.ListBuffer | |
| object NestedFinally { | |
| def main(args: Array[String]): Unit = { | |
| val es: ListBuffer[Exception] = ListBuffer.empty | |
| try { | |
| try { | |
| throw new Exception("1") |
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
| docker run --rm --entrypoint="/usr/lib/jvm/java-17-openjdk-amd64/bin/keytool" distroless/java17:nonroot -list -cacerts -storepass changeit |
NewerOlder