Skip to content

Instantly share code, notes, and snippets.

View ScalaWilliam's full-sized avatar
Working from home

ScalaWilliam ScalaWilliam

Working from home
View GitHub Profile
ScalaWilliam /
Last active July 17, 2021 02:59
Things yet to work in Scala 3 / sadly why I'm having difficulty migrating to it
ScalaWilliam / ResourceTimer.scala
Last active March 7, 2021 21:49
To debug how quickly different resources start up -- hugely important for application start up time. Used in
import cats.effect.{IO, Resource}
import io.chrisdavenport.log4cats.SelfAwareStructuredLogger
import java.time.{Duration, Instant}
object ResourceTimer {
implicit class RichResource[A](resource: Resource[IO, A]) {
def measured(
def of[F[_]](pf: PartialFunction[Request[F], HttpRoutes[F]])(
implicit F: Sync[F]): HttpRoutes[F] = {
Kleisli { req: Request[F] =>
// but we'd like to do multiple PartialFunctions here actually?
// and a PF is already a Kleisli of Option
def apply[F[_]: Monad, UserId](
java -jar sjk-plus.jar mxdump --pid $(jps|grep ProdSe|cut -f 1 -d ' ')|grep -A4 inters |grep -A4 reader^C

the concept is to do the appropriate thing for the appropriate time instead of guessing what the truth would be 2 years down the line, we try different things within 1 month timeframe or so then we can align more closely with the truth and the right thing all the time e.g. achievements was really really good at the beginning. listing who achieved what on the homepage is quite nice, but at some point we'll have achievements coming in every 5 minutes so we'll remove that information, because it's no good any more it's a conversation. And conversation is transitive, temporary, ephemeral but you can't get to the conclusion without having the conversation and going through the motions, the immediate steps 😀

ScalaWilliam Jan 24 09:08 page not useful any more, we should remove it and replace it with something different but it was very useful at the beginning @lucasgautheron I see 4 outstanding pull requests, planning to merge them at somepoint? 😀 just maybe not #111 o

ScalaWilliam /
Created June 26, 2017 00:34
Some attempts at seeing how Blogger handles HTTP caching
$ curl -H "If-None-Match: Tue, 10 Jan 2017 12:22:50 GMT" -i
HTTP/1.1 200 OK
Expires: Tue, 10 Jan 2017 12:30:24 GMT
Date: Tue, 10 Jan 2017 12:30:24 GMT
Cache-Control: private, max-age=0
Last-Modified: Tue, 10 Jan 2017 12:22:50 GMT
ScalaWilliam / actionfps-headings.tsv
Created June 26, 2017 00:33
Old historical stuff
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 1.
2015-12-01 Please consider spending 5 minutes every day in our <a href="!forum/actionfps">new Community Forum</a>. Your participation, activity and feedback is always welcome.
2016-03-30 Now we list <a href="">all players in the player ranks</a> regardless of their rank.
2016-04-01 Added the <a href="/hof/">Hall of Fame</a>! Should we have a prize for the first Cube Addict?<br/> Tell us <a href="">on the ActionFPS Gitter chatroom</a>.
2016-04-10 "Added a new server <a href=""assaultcube://"">Califa.ActionFPS.Com:1999</a> (Los Angeles, USA)<br/>Added a new server <a
href=""assaultcube://"">Bonza.ActionFPS.Com:1999</a> (Sydney, Australia)<br/>Added a new server <a
href=""assaultcube://"">Legal.ActionFPS.Com:1999</a> (São Paulo, Brazil)"
2016-04-22 Added the
ScalaWilliam /
Created June 26, 2017 00:31
Watching for changes for a specific file in Linux
inotifywait -m -e close_write,moved_to,create . |
while read -r directory events filename; do
if [ "$events" = "CLOSE_WRITE,CLOSE" ]; then
if [ "$filename" = "users.db.txt" ]; then
echo "K"