Skip to content

Instantly share code, notes, and snippets.

View tkon99's full-sized avatar
⌨️
Obsessing over macros

Thomas Konings tkon99

⌨️
Obsessing over macros
View GitHub Profile
@tkon99
tkon99 / client.html
Created August 25, 2022 12:18
Browsy - A proof of concept for a highly compressed web browser that can be used over any connection
<!DOCTYPE html>
<html>
<head>
<title>Browsy</title>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io();
// var viewer = document.getElementById("viewer");
@tkon99
tkon99 / index.mjs
Created August 9, 2022 17:34
WP-JSON to RSS proxy
import express from 'express';
import rateLimit from 'express-rate-limit';
import isValidDomain from 'is-valid-domain';
import fetch from 'node-fetch';
import Feed from 'pfeed';
const app = express();
const port = 2847;
/* Rate limiter */
@tkon99
tkon99 / crawl_public.js
Last active February 28, 2022 14:20
Littlefield Game Crawler (Supply Chain Management)
import got from "got";
import {CookieJar} from "tough-cookie";
import {writeFile} from 'fs/promises';
let cookieJar = new CookieJar();
let client = got.extend({ cookieJar });
// Enter details here
const settings = {
insitution: "", // This is part of your login url (e.g. https://op.responsive.net/lt/lse/ --> lse)
@tkon99
tkon99 / scrollbarfix.user.css
Last active January 17, 2022 22:27
Xbox Cloud Gaming Fullscreen Scrollbar Fix
/* ==UserStyle==
@name Xcloud Scrollbar Fix - 1/17/2022, 10:14:28 PM
@namespace github.com/openstyles/stylus
@version 1.0.1
@description Fixes the fullscreen vertical scrollbar bug on Xbox Cloud Gaming
@author tkon.nl
==/UserStyle== */
@-moz-document regexp("https://www.xbox.com/(.+)/play/(.+)") {
html.fullscreen {
overflow: hidden !important;
@tkon99
tkon99 / ImageComponent.astro
Created October 6, 2021 16:21
An example implementation of an Astro image component that retrieves an image from a given url, stores it locally and generates an img tag referring to the local copy.
---
/* Demo implementation of an Astro image component that
fetches a remote image and stores it locally, so it is
hosted on the same platform.
Can be expanded to generate srcset images for different
screen sizes and/or compress images for good Lighthouse
scores.
My usecase: using Notion as my CMS and saving thumbnails
@tkon99
tkon99 / lse_moodle.user.js
Last active October 3, 2021 16:08
LSE Moodle automated login (stop clicking the same buttons every day)
// ==UserScript==
// @name LSE Moodle automation
// @namespace http://tkon.nl
// @version 0.1
// @description Automate tedious LSE moodle login stuff
// @author You
// @match https://moodle.lse.ac.uk/*
// @icon https://moodle.lse.ac.uk/theme/image.php/synergycustom/theme/1633074455/favicon
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @grant none
@tkon99
tkon99 / maketiles.py
Created April 7, 2020 08:08
RDR2 Map Tile Creator
import glob
import math
import numpy
from pathlib import Path
from PIL import Image
Image.MAX_IMAGE_PIXELS = 933120000
zoomdir = "C:/Users/tkon9/Desktop/RDR2MapStream/content/maps/sat" # Essentially the output directory
@tkon99
tkon99 / parser.js
Created November 9, 2019 19:49
RDR2 Hashes (from photos)
var cheerio = require('cheerio');
var fs = require('fs');
var parseurl = require('parseurl');
var queryString = require('querystring');
var path = require('path');
let files = fs.readdirSync('htmls');
let toAnalyze = [];
for(x in files){
@tkon99
tkon99 / bocconi_rooms.json
Created September 9, 2019 14:08
Bocconi University Buildings and Rooms used in BOCi.tkon.nl
[
{
"building": "Sarfatti 25",
"floors": {
"basement": ["INFOU01"],
"ground": [1,2,3,4,"A","B","C","D","E","F","Norari","Zappa","INFO6"],
"1st": [11,12,13,14,15,16,101,"Manfredini","Perego"],
"2nd": [21,22,23,24,25,26,201,202,203,204,205,206,"Maggiore","ES2M"],
"3rd": [31,32,33,34,34,35,36,301,302],
"4th": [41,42,43,44,"4a","4b","4c"]
@tkon99
tkon99 / guide.md
Last active December 20, 2023 14:06
Use Mosh on Windows from the Command Prompt

Hi all. After wanting true color support in Mosh (to use Brow.sh), I also wanted to integrate it more tightly with Windows. Since I reckon more people will be wanting to accomplish this, here is a guide.

  1. Install Linux Subsystem for Windows if you haven't already (https://docs.microsoft.com/en-us/windows/wsl/install-win10) (I use Ubuntu)
  2. Make sure you can execute bash from a CMD prompt.
  3. Go into the bash environment by executing bash ~ in CMD prompt
  4. Install Mosh-dev (for up-to-date version) from https://launchpad.net/~keithw/+archive/ubuntu/mosh-dev by doing sudo add-apt-repository ppa:keithw/mosh-dev then sudo apt-get update
  5. Create a new mosh.bat file on your Desktop with the following contents
@echo off