Skip to content

Instantly share code, notes, and snippets.

View stewSquared's full-sized avatar
Advent of Code 2023

Stewart Stewart stewSquared

Advent of Code 2023
View GitHub Profile
@bishabosha
bishabosha / aoc-2021-day22.scala
Last active July 12, 2022 10:49
Advent of Code 2021 Day 22 Neal Wu solution
// using scala 3.0.2
package day22
import scala.util.Using
import scala.io.Source
import scala.collection.mutable
@sm-Fifteen
sm-Fifteen / whats_a_yubikey.md
Last active September 16, 2024 19:49
"What the heck is a Yubikey and why did I buy one?": A user guide

"What the heck is a Yubikey and why did I buy one?": A user guide

(EDIT: Besides Reddit, I've also put this up on Github Gist)

So while looking for information on security keys before getting one myself, I got very confused reading about all the different modes and advertised features of Yubikeys and other similar dongles. The official documentation tends to be surprisingly convoluted at times, weirdly organized and oddly shy about a few of the limitations of these keys (which I'm making a point of putting front and center). Now that I have one, I decided to write down everything I figured out in order to help myself (and hopefully some other people reading this) make sense of all this.

Since I'm partly writing these notes for myself, there might be some back and forth between "exp

@tpolecat
tpolecat / libs.md
Last active December 17, 2021 16:50
tpolecat library status

Latest releases and supported Scala versions for org.tpolecat stuff

Release 2.12 2.13 3.0.0 Notes
Atto 0.9.5
Doobie (CE2) 0.13.4
Doobie (CE3) 1.0.0-M5
Natchez (CE2) 0.0.26 EOL
Natchez (CE3) 0.1.3
@btlines
btlines / F.scala
Created September 6, 2020 13:34
A better Future
package effects
import cats.{MonadError, StackSafeMonad}
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success, Try}
final case class F[+E, +A](value: Future[Either[E, A]]) extends AnyVal {
def fold[B](fe: E => B, fa: A => B)(implicit ec: ExecutionContext): Future[B] = value.map {
@mcpower
mcpower / aoc-tips.md
Last active November 12, 2024 02:19
Tips for getting on the Advent of Code leaderboard

Hi, I'm mcpower. I've done Advent of Code seriously for two years now in Python, placing 9th in 2018 and 12th in 2017. This year, I'm taking a break from aiming for the leaderboard - while it's fun and all, it is a bit stressful at times (the good kind of stress, though!). As such, I'd like to share a few tips for anyone wanting to aim for the leaderboard.

This is everything that worked for me. Your mileage may vary, though - don't take this as gospel, see what works for you.

Go fast

Go fast.

@abeln
abeln / scala-explicit-nulls.md
Last active December 18, 2020 13:57
Scala with Explicit Nulls
@allenyllee
allenyllee / install_tools.sh
Last active November 6, 2024 04:12
mount vhdx in linux
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@wsargent
wsargent / win10-dev.md
Last active August 7, 2024 18:20
Windows Development Environment for Scala

Windows 10 Development Environment for Scala

This is a guide for Scala and Java development on Windows, using Windows Subsystem for Linux, although a bunch of it is applicable to a VirtualBox / Vagrant / Docker subsystem environment. This is not complete, but is intended to be as step by step as possible.

Harden Windows 10

Read the entire Decent Security guide, and follow the instructions, especially:

trait Foo[A] {
type Out
def apply(): Out
}
object Foo {
type Aux[A, B] = Foo[A] { type Out = B }
implicit val bfoo: Aux[Bar, Int] = new Foo[Bar] {
type Out = Int