Skip to content

Instantly share code, notes, and snippets.

View mwtaylor's full-sized avatar
👋
Hi

Michael Taylor mwtaylor

👋
Hi
View GitHub Profile
@mwtaylor
mwtaylor / Reference.kt
Created May 23, 2025 00:14
Kotlin language reference
package dev.mwtaylor.terraincognita.demo
class Hello(private val name: String = "World") {
fun sayHello() {
println("Hello, ${name}!!!")
}
}
fun main() {
val hello = Hello()
@mwtaylor
mwtaylor / reference.rb
Last active May 15, 2025 02:21
Ruby Language Reference
3.times do
puts 'Hello World'
end
class Greeter
attr_accessor :name
def initialize(name = "World")
@name = name
end
@mwtaylor
mwtaylor / .UkkonenAlgorithmKotlin
Last active February 26, 2025 10:36
Implement Ukkonen's algorithm in Kotlin for constructing a suffix tree
https://en.wikipedia.org/wiki/Ukkonen%27s_algorithm
https://en.wikipedia.org/wiki/Suffix_tree
https://www.cs.helsinki.fi/u/ukkonen/SuffixT1withFigs.pdf
Example in Node of how to run many async tasks in parallel with a limit of how many can run at once and then collect all the results.
@mwtaylor
mwtaylor / .CookieClickerNumberFormatting
Last active January 17, 2024 00:07
Format big numbers to display in games like Cookie Clicker
Format large numbers to show in a game. Customizable to show in a few different formats such as:
- 1,234,567
- 1.234 T
- 1e⁹⁹⁹
Designed for United States English locale only.
@mwtaylor
mwtaylor / .Java21PatternMatching
Last active September 21, 2023 22:16
Learning to use Java 21 pattern matching
https://openjdk.org/jeps/441
@mwtaylor
mwtaylor / .JavaInternationalizationDemo
Last active September 21, 2023 18:17
Demo of Internationalization in Java
This Gist contains a demo of how to use internationalization in Java, including:
- formatting numbers
- formatting percents
- formatting dates and times
- formatting currency
- showing translated messages