Skip to content

Instantly share code, notes, and snippets.

View Fohlen's full-sized avatar

Lennard Berger Fohlen

View GitHub Profile
@Fohlen
Fohlen / count_bytes.js
Created October 15, 2022 03:38
Reddit Comments Archive
$$('.file').filter((tr) => tr.childNodes[1].innerText.startsWith("RC_")).map((tr) => parseInt(tr.childNodes[5].innerText.replaceAll(",", ""))).reduce((a, b) => a + b)
@Fohlen
Fohlen / texture.cpp
Last active May 4, 2021 12:40
List textures patch
static hashtable<int, int> *listtextures;
static int maxlisted;
void listtexcube(cube &c)
{
if (!c.children)
loopi(6)
{
int t = c.texture[i];
(*listtextures)[t] = 1;
@Fohlen
Fohlen / duels.tsv
Last active January 24, 2021 10:36
SauerDuels
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 39 columns, instead of 35 in line 3.
Time Mode Map Name Frags Deaths Damage DamageDealt Suicides TotalShots ShotsDealt FistDamage FistDamageDealt ShotgunDamage ShotgunDamageDealt ChaingunDamage ChaingunDamageDealt RocketLauncherDamage RocketLauncherDamageDealt RifleDamage RifleDamageDealt GrenadeLauncherDamage GrenadeLauncherDamageDealt PistolDamage PistolDamageDealt FistShots FistShotsDealt ShotgunShots ShotgunShotsDealt ChaingunShots ChaingunShotsDealt RocketLauncherShots RocketLauncherShotsDealt RifleShots RifleShotsDealt GrenadeLauncherShots GrenadeLauncherShotsDealt PistolShots PistolShotsDealt
1513709372 5 turbine vaQ'Erika 62 54 57210 13858 0 1022 299 0 0 4200 810 21630 5790 21960 4478 6900 2800 2520 281 0 0 0 0 21 17 721 193 183 65 69 28 28 4 0 0
1513709372 5 turbine glory|bug 53 63 67430 11985 1 1347 259 0 0 3200 490 31230 4530 25800 6015 4500 1000 2700 137 0 0 0 0 16 12 1041 151 215 91 45 10 30 2 0 0
1513709372 5 ot glory|h8 38 76 39620 8573 0 667 156 0 0 3000 970 12780 2490 11040 2897 7400 2300 5400 340 0 0 0 0 15 11 426 83 92 42 74 2
@Fohlen
Fohlen / color-scheme.d.ts
Created January 21, 2021 09:22
(Incomplete) TypeScript typings for color-scheme
declare module 'color-scheme' {
export interface ColorScheme {
/**
* Set the scheme to [scheme_name]. The possible values are 'mono', 'contrast', 'triade', 'tetrade', and 'analogic'.
*/
scheme(scheme_name: string): ColorScheme;
/**
* Note: Only works with the schemes 'triade', 'tetrade', and 'analogic'. (Because 'mono' only has one source color, and with 'contrast' the two source colors are always 180 degrees away from each other.)
@Fohlen
Fohlen / effic.tsv
Last active January 10, 2021 12:13
SSL stats
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 39 columns, instead of 33 in line 3.
Time Mode Map Name Frags Deaths Damage DamageDealt Suicides TotalShots ShotsDealt FistDamage FistDamageDealt ShotgunDamage ShotgunDamageDealt ChaingunDamage ChaingunDamageDealt RocketLauncherDamage RocketLauncherDamageDealt RifleDamage RifleDamageDealt GrenadeLauncherDamage GrenadeLauncherDamageDealt PistolDamage PistolDamageDealt FistShots FistShotsDealt ShotgunShots ShotgunShotsDealt ChaingunShots ChaingunShotsDealt RocketLauncherShots RocketLauncherShotsDealt RifleShots RifleShotsDealt GrenadeLauncherShots GrenadeLauncherShotsDealt PistolShots PistolShotsDealt
1439108964 6 academy .cS|neon 61 34 52250 14851 3 843 267 0 0 4200 1170 16530 3570 26520 8885 5000 1800 0 0 0 0 0 0 21 17 551 119 221 133 50 18 0 0 0 0
1439108964 6 academy <sAs/Butters> 30 65 52850 7014 1 996 166 0 0 6200 520 22200 3150 14760 2162 5100 1000 4590 276 0 0 0 0 31 15 740 105 123 34 51 10 51 5 0 0
1439111440 5 academy w00p|BenKei 50 44 49650 11180 1 815 221 0 0 3800 730 15690 3660 20280 5043 5200 1400 4680 602 0 0 0 0 19 11 523 122 169 7
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y build-essential zlib1g-dev git
RUN git clone https://github.com/tomatenquark/code.git --depth 1
RUN mkdir storage
RUN cd /code/src/ && make master
WORKDIR /storage
CMD /code/src/tomaten_master /storage/ 28787 0.0.0.0
@Fohlen
Fohlen / assets.go
Created March 18, 2020 15:12
Read relevant information from a cfg file
import (
"bufio"
"fmt"
"os"
"strings"
)
type Resource struct {
property, path string
}
@Fohlen
Fohlen / pareto.ipynb
Created December 4, 2019 09:22
British national corpus
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Fohlen
Fohlen / foo.sh
Created October 22, 2019 21:57 — forked from waylan/foo.sh
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""
@Fohlen
Fohlen / location_counts.sql
Last active October 10, 2019 21:03
City analysis for eventzimmer
COPY (SELECT locations.latitude, locations.longitude, (SELECT COUNT(*) FROM eventzimmer.events WHERE events.location = locations.name) FROM eventzimmer.locations) TO stdout WITH csv;