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
// See: https://adventofcode.com/2022/day/12 | |
use std::collections::VecDeque; | |
#[derive(Debug, Copy, Clone)] | |
struct Point { | |
character: char, | |
elevation: usize, | |
distance: Option<usize>, | |
} |
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
// See: https://adventofcode.com/2022/day/10 | |
#[derive(Debug, Copy, Clone)] | |
enum Cmd { | |
Noop, | |
Addx(isize), | |
} | |
#[derive(Debug, Copy, Clone)] | |
struct State { |
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
// 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() | |
} |
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
@startuml | |
<style> | |
diamond { | |
BackgroundColor #palegreen | |
LineColor #green | |
LineThickness 2.5 | |
} | |
</style> | |
!$START = "Public toot by @name" |
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 | |
# 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) |
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
<!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"> |
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
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() |
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
import kotlin.properties.Delegates | |
interface Publisher { | |
fun onNews(news: String) | |
} | |
class RadioChannel : Publisher { | |
override fun onNews(news: String) = println("Heard on radio: $news") | |
} |
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
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() | |
} | |
/** |