Skip to content

Instantly share code, notes, and snippets.

View simonwep's full-sized avatar
🎯
Focusing...

Simon simonwep

🎯
Focusing...
View GitHub Profile
// ==UserScript==
// @name Spotify ad skipper
// @version 1.0
// @namespace http://tampermonkey.net/
// @description Detects and skips ads on spotify
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
// @updateURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
@simonwep
simonwep / blockadblock-blocker.tapermonkey.js
Last active September 30, 2023 14:32
Blocks BlockAdBlock scripts
// ==UserScript==
// @name BlockAdblock Blocker
// @version 1.0
// @namespace http://tampermonkey.net/
// @description Blocks block-adblock
// @match *://**/*
// @grant none
// @run-at document-start
// ==/UserScript==
@simonwep
simonwep / FXResizeHelper.java
Created February 5, 2018 14:46
Helper class to resize an undecorated JavaFX Stage.
package classes;
import javafx.event.EventHandler;
import javafx.scene.Cursor;
import javafx.scene.Scene;
import javafx.scene.input.MouseEvent;
import javafx.stage.Screen;
import javafx.stage.Stage;
import java.util.HashMap;
@simonwep
simonwep / APIDocExample.md
Last active February 1, 2023 06:45
An API-Documentation example README

API Documentation Example

This API uses POST request to communicate and HTTP response codes to indenticate status and errors. All responses come in standard JSON. All requests must include a content-type of application/json and the body must be valid JSON.

Response Codes

Response Codes

200: Success
400: Bad request
401: Unauthorized
404: Cannot be found
@simonwep
simonwep / clozemaster-enhanced.tapermonkey.js
Last active December 30, 2021 17:30
Adds a few features to clozemaster.com to practice even faster
// ==UserScript==
// @name Closemaster enhanced
// @namespace http://tampermonkey.net/
// @version 4.1.2
// @description Adds a few features to clozemaster.com to practice even faster
// @author You
// @match https://*.clozemaster.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Simonwep/9341a5881f6b89973305d9f3291d94fa/raw
@simonwep
simonwep / docker-ubuntu-x86.sh
Last active July 9, 2021 14:44
Install docker on a x86 ubuntu machine
#!/bin/bash
# This follows the instructions on https://docs.docker.com/engine/install/ubuntu/ and https://docs.docker.com/compose/install/
# curl -sSL https://gist.githubusercontent.com/Simonwep/b53b6ad8d4086f45a6834c051ae1762c/raw/6fca24bd46a18e125667c18438a0ea92ff459e9d | bash
set -ex
# Remove old packages
sudo apt-get remove docker docker-engine docker.io containerd runc
# Install dependencies
@simonwep
simonwep / ts-deep-entity-select.ts
Last active February 2, 2021 07:02
Helper types to resolve selectables
interface User {
id: number;
userName: string;
fullName: string;
}
interface Comment {
id: number;
body: string;
author: User;
const selection = new SelectionArea({
// All elements in this container can be selected
selectables: ['.box-wrap > div'],
// The container is also the boundary in this case
boundaries: ['.box-wrap']
}).on('start', ({store, event}) => {
// Remove class if the user isn't pressing the control key or ⌘ key
@simonwep
simonwep / github-style-fix.js
Last active July 17, 2020 06:56
Fixes large-screen style issues on github.com
// ==UserScript==
// @name GitHub Style Fixes
// @version 1.2.0
// @namespace http://tampermonkey.net/
// @description The new github design has issues, this can be used to fix them.
// @match https://*.github.com/*
// @grant none
// @run-at document-end
// @downloadURL https://gist.githubusercontent.com/Simonwep/a3926348cb45cc510382ca5cb10f364e/raw
// @updateURL https://gist.githubusercontent.com/Simonwep/a3926348cb45cc510382ca5cb10f364e/raw
@simonwep
simonwep / deploy-gh-pages.sh
Created May 17, 2020 17:20
Deploy a nodejs project to gh-pages
#!/bin/bash
BRANCH="gh-pages"
echo "[DGP] Deploying to github-pages (branch $BRANCH)..."
# Check if there are current changes
if [[ "$(git status --porcelain --untracked-files=no)" ]]; then
echo "[DPG] Please undo your current changes."
exit
fi