Skip to content

Instantly share code, notes, and snippets.

View theme-switch-animated-icon-color.css
* This is an example of making a CSS animated color property for
* the theme-switch component (
* This gist is referenced in the documentation of the component.
* Currently, only Chromium-based browsers (Chrome, Opera, Edge, etc.) support this.
* See for more information.
* For a real-world example, see
* and its source code on
mahozad / hello.main.kts
Last active Nov 30, 2021
Kotlin script hello world example. Can be run from the command line with `kotlin hello.main.kts` command. Ensure Kotlin compiler is installed on your machine and is added to the PATH. You can also run the script with `hello.main.kts` command on Linux given Kotlin is available in /usr/bin/env/.
View hello.main.kts
#!/usr/bin/env kotlin
println("Hello World!")
mahozad / scraper.main.kts
Last active Dec 3, 2021
A Kotlin script to scrape a phrase from a dynamic page using Selenium and jsoup (mentioned in a Stack Overflow post)
View scraper.main.kts
#!/usr/bin/env kotlin
* A Kotlin script for extracting (scraping) a phrase from a dynamic page.
* NOTE: Download and place the executable [Chrome driver]( beside this script.
* See [this stackoverflow post]( for more information.
* Alternatively, use the [WebDriverManager]( library.
mahozad /
Last active Mar 27, 2020
The fix for the bug in NumberUtils class in Thymeleaf
private static DecimalFormatSymbols computeDecimalFormatSymbols(
final NumberPointType decimalPointType, final NumberPointType thousandsPointType, final Locale locale) {
Validate.notNull(decimalPointType, "Decimal point type cannot be null");
Validate.notNull(thousandsPointType, "Thousands point type cannot be null");
Validate.notNull(locale, "Locale cannot be null");
final DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
switch (decimalPointType) {