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
#!/usr/bin/java --source 21 | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; |
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
#!/usr/bin/env bash | |
GREETING="hello, world!" | |
echo ${GREETING} | |
echo ${GREETING^} | |
echo ${GREETING^^} | |
exit 0 |
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
#!/usr/bin/env -S java --source 21 --enable-preview | |
/* | |
FizzBuzz demonstrating JDK 21 LTS features | |
*/ | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.stream.IntStream; |
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
#!/usr/bin/node | |
import { parseArgs } from 'node:util'; | |
/* | |
Based on the Commodore 64 single line maze generator | |
10 PRINT CHR$(205.5+RND(1)); : GOTO 10 | |
as described at https://10print.org/ | |
*/ |
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
jshell> var s = new URL("https://www.caymanchem.com/") | |
s ==> https://www.caymanchem.com/ | |
jshell> var t = new URL("https://www.caymanpharma.com/") | |
t ==> https://www.caymanpharma.com/ | |
jshell> s.equals(t) | |
$3 ==> true | |
As seen on https://twitter.com/tnurkiewicz/status/1519643900423688192 |
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
#!/usr/bin/env -S java --source 11 | |
import java.util.Random; | |
import java.util.concurrent.TimeUnit; | |
/** | |
Based on the Commodore 64 single line maze generator | |
10 PRINT CHR$(205.5+RND(1)); : GOTO 10 | |
as described at https://10print.org/ |
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
// https://www.facebook.com/Heavydsparks/photos/a.1432147377066939/2976473412634320/ | |
const f = (n) => n * (n + 1); | |
console.log([9, 8, 7, 6, 3].map(f)); | |
// Output: [ 90, 72, 56, 42, 12 ] |
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
#!/usr/bin/env node | |
// Based on the Commodore 64 single line maze generator | |
// 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 | |
// as described at https://10print.org/ | |
while (true) process.stdout.write(['\u2571','\u2572'][Math.floor(0.5 + Math.random())]); |
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
/* Commodore 64 color values from https://www.c64-wiki.com/wiki/Color */ | |
:root { | |
--c64-black: #000000; | |
--c64-white: #ffffff; | |
--c64-red: #880000; | |
--c64-cyan: #aaffee; | |
--c64-violet: #cc44cc; --c64-purple: var(--c64-violet); | |
--c64-green: #00cc55; | |
--c64-blue: #0000aa; | |
--c64-yellow: #eeee77; |
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
#!/bin/bash | |
jshell -<<EOF | |
System.out.println("Hello, world!"); | |
/exit | |
EOF |
NewerOlder