Since I don't want to include the Vue.js JavaScript code in every page, I control it with a parameter in the post's frontmatter.
---
vue: 2
---
import org.apache.directory.mavibot.btree.* | |
import org.apache.directory.mavibot.btree.exception.KeyNotFoundException | |
import org.apache.directory.mavibot.btree.serializer.* | |
import java.util.* | |
fun main(args: Array<String>) { | |
btreeExample() | |
} | |
/** |
import kotlin.properties.Delegates | |
interface Publisher { | |
fun onNews(news: String) | |
} | |
class RadioChannel : Publisher { | |
override fun onNews(news: String) = println("Heard on radio: $news") | |
} |
import akka.actor.AbstractActor | |
import akka.actor.ActorRef | |
import akka.actor.ActorSystem | |
import akka.actor.Props | |
import com.typesafe.config.Config | |
import com.typesafe.config.ConfigFactory | |
class Worker : AbstractActor() { | |
override fun createReceive(): Receive? { | |
return receiveBuilder() |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Game of Fifteen</title> | |
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@^2.0/dist/tailwind.min.css"> | |
</head> | |
<body class="m-4 bg-gray-100 antialiased"> |
#!/bin/bash | |
# Copyright 2022 Thomas Weitzel | |
# This script has some dependencies: | |
# - needs bash compatible shell (https://www.gnu.org/software/bash/) | |
# - curl (https://curl.se/) | |
# - ripgrep (https://github.com/BurntSushi/ripgrep/) | |
# Install these tools before using it | |
# Login form parameters (example) |
@startuml | |
<style> | |
diamond { | |
BackgroundColor #palegreen | |
LineColor #green | |
LineThickness 2.5 | |
} | |
</style> | |
!$START = "Public toot by @name" |
// See: https://adventofcode.com/2022/day/8 | |
fn parse(input: &str) -> Vec<Vec<u32>> { | |
input | |
.lines() | |
.map(|line| { | |
line.chars().map(|c| c.to_digit(10).expect("NaN")).collect() | |
}) | |
.collect() | |
} |
// See: https://adventofcode.com/2022/day/10 | |
#[derive(Debug, Copy, Clone)] | |
enum Cmd { | |
Noop, | |
Addx(isize), | |
} | |
#[derive(Debug, Copy, Clone)] | |
struct State { |
// See: https://adventofcode.com/2022/day/12 | |
use std::collections::VecDeque; | |
#[derive(Debug, Copy, Clone)] | |
struct Point { | |
character: char, | |
elevation: usize, | |
distance: Option<usize>, | |
} |