Skip to content

Instantly share code, notes, and snippets.

@jordyvandomselaar
jordyvandomselaar / file.js
Last active April 4, 2025 03:23
Remove all message requests on Twitter that appear to be spam, paste it in an Arc boost or something idk.
// ==UserScript==
// @name Twitter spam DM deleter
// @namespace http://tampermonkey.net/
// @version 2025-04-01
// @description try to take over the world!
// @author You
// @match https://x.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=x.com
// @grant none
// ==/UserScript==
import {GetStaticPaths, GetStaticProps} from "next";
import {getPostPathBySlug, getPostSlugs, markdownFileToPost, Post as PostInterface} from "../../services/posts";
import {MDXRemote, MDXRemoteSerializeResult} from 'next-mdx-remote'
import {serialize} from 'next-mdx-remote/serialize'
import Content from "../../components/Content";
import Layout from "../../components/Layout";
import Footer from "../../components/Footer";
import path from "path";
import Hero from "../../components/Hero";
import Image from "next/image"
@jordyvandomselaar
jordyvandomselaar / set.js
Created September 5, 2021 01:00
JS isn't always as consistent as we'd like it to be
// First, we create a new Set. When we look at the documentation for Set: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set
// We see the following: "The Set constructor lets you create Set objects that store unique values of any type, whether primitive values or object references."
// This means that when creating a Set with multiple values, it only stores UNIQUE values in that set.
// Example:
const mySet = new Set([1, 2, 3, 1, 2, 3]);
console.log(mySet);
// Set {
// 1,
// 2,
import styled from "styled-components";
interface NoticeProps {
variant: "hint" | "important";
}
const backgroundColors: { [key: string]: string } = {
hint: "#01920124",
important: "#ffff002e",
};
// Reduce loops through an array, giving you access to each item. It'll also give access to the current "result".
// You can specify an initial value which reduce will use to initialize the "result" variable.
const myArray = [
1,
2,
3
];
const initialValue = [];
@jordyvandomselaar
jordyvandomselaar / index.js
Created August 19, 2020 12:41
Get key by value
// Easily get object key by value
const referrerSources = {
"aws": "AWS Cloud",
"oudesoft": "Oude software",
"mvp": "Voordelen van een MVP",
"corona": "Corona Consult"
}
// Object entries transforms an object into an array with sub arrays with key & value:
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
./src/assets/fonts/Arvo/Arvo-BoldItalic.ttf 1:0
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
./src/assets/fonts/Arvo/Arvo-Italic.ttf 1:0
@jordyvandomselaar
jordyvandomselaar / Clear all youtube subscriptions.js
Last active May 2, 2020 11:42
Go to https://www.youtube.com/feed/channels, scroll all the way to the bottom then run this script to clear all of your subscriptions.
const unSubscribe = () => {
Array.from(document.querySelectorAll("yt-formatted-string"))
.find(yfs => yfs.textContent === "Subscribed")
.click();
setTimeout(() => {
Array.from(document.querySelectorAll("yt-formatted-string"))
.filter(yfs => yfs.textContent === "Unsubscribe")
.forEach(yfs => yfs.click());
}, 400);
@jordyvandomselaar
jordyvandomselaar / .hyper.js
Created February 19, 2019 10:20
My Hyper config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
scrollback: 5000,
// default font size in pixels for all tabs
fontSize: 16,