Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
; is so overrated

Max Rydahl Andersen maxandersen

💭
; is so overrated
View GitHub Profile
View gist:42182eb242b30e43aff53bba44c23070
def can_complete_word(word, word_with_blanks):
# Remove all non-alphabetic characters from the word with blanks
word_with_blanks = ''.join(filter(str.isalpha, word_with_blanks))
# Check if the word with blanks is longer than the word
if len(word_with_blanks) > len(word):
return False
# Iterate through each letter in the word with blanks
for i, c in enumerate(word_with_blanks):
View gist:ff574656e0dc9d724ea929cc09560d9e
> Windup CLI 6.1.4.Final (Windup Components 6.1.4.Final) https://github.com/windup/windup
View jjfq.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.6.3
//DEPS com.ibm.jsonata4java:JSONata4Java:2.2.6
//DEPS com.fasterxml.jackson.core:jackson-databind:2.9.8
import static java.lang.System.out;
import java.io.IOException;
import java.nio.file.Path;
View a.btm
RULE trace main entry
CLASS AppMain
METHOD main
AT ENTRY
IF true
DO traceln("entering main")
View gist:a1be7f5ab39113bb01e7a4083112b934
subjects:
- command: manifest show
jar:
file: ST4-4.0.8.jar
size: 239543
sha256: 58caabc40c9f74b0b5993fd868e0f64a50c0759094e6a251aaafad98edfc7a3b
result:
manifest: java.util.jar.Manifest@5426d89e
@maxandersen
maxandersen / init.lua
Created August 25, 2019 21:49
HammerSpoon Text Expansion Feature
View init.lua
--[[
=== HammerText ===
Based on: https://github.com/Hammerspoon/hammerspoon/issues/1042
How to "install":
- Simply copy and paste this code in your "init.lua".
How to use:
- Add this init.lua to ~/.hammerspoon/Spoons/HammerText.spoon
- Add your hotstrings (abbreviations that get expanded) to the "keywords" list following the example format.
View VirtualThreadReflectionBenchmark.java
//JAVA 19
//DEPS org.openjdk.jmh:jmh-generator-annprocess:1.36
//JAVA_OPTIONS --enable-preview --add-opens java.base/java.lang=ALL-UNNAMED
// to run with javagagent add the following:
// `--javaagent=ap-loader@maxandersen=start,event=cpu,file=profile.html`
package red.hat.puzzles.loom;
import java.lang.invoke.MethodHandle;
View gist:5d6f6f2e30f12da7bf064b32548d96fb
jbang -m org.jbake.launcher.Main --deps info.picocli:picocli:RELEASE,org.eclipse.jetty:jetty-server:RELEASE,org.apache.commons:commons-vfs2:RELEASE --java 17 org.jbake:jbake-core:RELEASE --help
View Main.java
//DEPS io.micronaut:micronaut-http-server-netty:3.5.2
//DEPS org.slf4j:slf4j-simple:1.6.1
//DEPS io.micronaut:micronaut-http-client:3.5.2
//DEPS io.micronaut:micronaut-inject-java:3.5.2
//SOURCES MicroController.java
//JAVA 17+
package jbang.test;
import io.micronaut.runtime.Micronaut;
View 0.100.txt
rm -rf ~/.jbang/bin/jbang* && curl -Ls https://sh.jbang.dev | JBANG_DOWNLOAD_VERSION=0.100.0 bash -s - app setup && jbang --fresh --verbose --java 17 -DPSWD=c6fa_41b6_9f2b quarkusclidb.java
Downloading JBang 0.100.0...
Installing JBang...
[jbang] JBang environment is already set up.
[jbang] jbang version 0.100.0
[jbang] Building as fresh build explicitly requested.
[jbang] System Java version detected as 17
[jbang] System Java version matches requested version 17
[jbang] Repositories: mavencentral=https://repo1.maven.org/maven2/
[jbang] Resolving dependencies...