Skip to content

Instantly share code, notes, and snippets.

View telyn's full-sized avatar
🌈

Telyn telyn

🌈
View GitHub Profile
@telyn
telyn / Install-UT2004.md
Last active July 19, 2024 20:03
Installing UT2004 on a linux

So you want to install UT2004 on some Linux? Because 10 year old games are the best games.

You will need:

  • UT2004 (The GOG copy or the original DVD will both work, as will presumably any other copy of UT2004)
  • The latest (3369) linux patch for UT2004
  • A CD key. If you want to run a dedicated server, generate yourself a server key at https://forums.unrealtournament.com/utserver/cdkey.php?2004
  • libstdc++.so.5 (could also end .so.5.X.Y where X and Y are numbers, this is also fine) built for i386 linux. the 64-bit build of UT2004 is sadly broken (can't rebind ports on map changes, making the web interface useless after the first map), so i386 is the way forward.

The steps:

@telyn
telyn / chain.go
Last active April 15, 2024 06:42 — forked from anonymous/chain.go
Function chaining in go. It's essentially the same as the Either Monad - but a little less monad-y
package chain
import (
"fmt"
"reflect"
)
// Chain takes an array of functions, and calls them all, passing the result of the previous call to the next. Any funcs whose last return value is an error have the errors checked and not passed to the next. If an error occurs at any point chain returns with an empty list and the error that happened.
// here it is expressed vaguely maths-y which might be clearer.
// given a function f[n] which returns a set of values vs:
@telyn
telyn / mean-string.rb
Created September 17, 2019 15:03
Find out what the mean string is from a yaml document of strings (for a ... particular definition of "mean string")
require 'set'
# Calculates the mean string
class MeanString
def initialize(strings)
@strings = strings
end
def mean
(0...average_string_length)