Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Obsessing over macros

Thomas Konings tkon99

⌨️
Obsessing over macros
View GitHub Profile
@tkon99
tkon99 / crawl_public.js
Last active Feb 28, 2022
Littlefield Game Crawler (Supply Chain Management)
View crawl_public.js
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 Jan 17, 2022
Xbox Cloud Gaming Fullscreen Scrollbar Fix
View scrollbarfix.user.css
/* ==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 Oct 6, 2021
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.
View ImageComponent.astro
---
/* 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 Oct 3, 2021
LSE Moodle automated login (stop clicking the same buttons every day)
View lse_moodle.user.js
// ==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 Apr 7, 2020
RDR2 Map Tile Creator
View maketiles.py
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 Nov 9, 2019
RDR2 Hashes (from photos)
View parser.js
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 Sep 9, 2019
Bocconi University Buildings and Rooms used in BOCi.tkon.nl
View bocconi_rooms.json
[
{
"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 Feb 17, 2021
Use Mosh on Windows from the Command Prompt
View guide.md

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
@tkon99
tkon99 / index.html
Created Jul 10, 2015
Coding Tutorial - Chap. 3 - Using Frameworks
View index.html
<html>
<head>
<title>Using Frameworks!</title>
<!-- This is where the magic happens. We include the bootstrap files from their server. !-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<h1>Your content goes here.</h1>
</body>
@tkon99
tkon99 / schools.json
Created Jun 15, 2015
All gepro-osi schools
View schools.json
[25,33,36,41,47,59,63,65,80,81,89,97,135,139,142,178,179,181,185,191,199,211,213,218,222,228,231,232,285,288,302,319,337,348,356,358,368,385,387,397,398,400,401,406,415,418,419,445,447,448,449,453,455,464,472,495,500,507,508,511,519,535,547,552,555,559,590,600,601,605,606,620,650,655,675,676,689,691,693,702,703,716,718,723,742,747,767,768,790,809,810,811,812,818,821,823,842,846,847,893,905,906,912,918,919,928,934,947,948,952,958,962,980,986]