Skip to content

Instantly share code, notes, and snippets.

View vaaski's full-sized avatar

vaaski

View GitHub Profile
<?xml version="1.0" encoding="UTF-16"?>
<!-- replace DEVICE_NAME_REPLACE_ME in the <Subscription> tag -->
<!-- find the name in event viewer: Microsoft/Windows/Audio/Operational -->
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Author>vaaski</Author>
<Description></Description>
<URI>\restart voicemeeter on bluetooth connect</URI>
</RegistrationInfo>
@vaaski
vaaski / youtube-focus-player.user.js
Last active November 18, 2022 01:14
always focus the youtube player so that you never change volume with left/right arrow keys
// ==UserScript==
// @name always focus player
// @namespace https://gist.github.com/vaaski/d32d4a7d22c02f4343c4a2d885c6b6d2
// @updateURL https://gist.github.com/vaaski/d32d4a7d22c02f4343c4a2d885c6b6d2/raw/youtube-focus-player.user.js
// @downloadURL https://gist.github.com/vaaski/d32d4a7d22c02f4343c4a2d885c6b6d2/raw/youtube-focus-player.user.js
// @version 2
// @description always focus the youtube player so that you never change volume with left/right arrow keys
// @author vaaski
// @match https://youtube.com/*
// @match https://*.youtube.com/*
@vaaski
vaaski / fuckmodland.user.js
Last active October 22, 2022 13:46
don't open 6372583 tabs and skip 5s download wait on modland.net
// ==UserScript==
// @name fuck modland
// @namespace https://gist.github.com/vaaski/62252e2ab70b3d6f4232d764308004b0
// @updateURL https://gist.github.com/vaaski/62252e2ab70b3d6f4232d764308004b0/raw/fuckmodland.user.js
// @downloadURL https://gist.github.com/vaaski/62252e2ab70b3d6f4232d764308004b0/raw/fuckmodland.user.js
// @version 1
// @description don't open 6372583 tabs and skip 5s download wait
// @author vaaski
// @match https://*.modland.net/*
// @match https://modland.net/*
@vaaski
vaaski / bd3d4befe38185704bf0fc875e9deed6\configuration.json
Created March 27, 2022 11:37
Visual Studio Code Settings Sync Gist
{"contents":{"launch":{"version":"0.2.0","configurations":[{"name":".NET Core Launch (console)","type":"coreclr","request":"launch","preLaunchTask":"build","program":"${workspaceFolder}/src/api/bin/Debug/netcoreapp2.1/api.dll","args":[],"cwd":"${workspaceFolder}/src/api","console":"externalTerminal","stopAtEntry":false,"internalConsoleOptions":"openOnSessionStart"},{"name":".NET Core Attach","type":"coreclr","request":"attach","processId":"${command:pickProcess}"}]}},"overrides":[],"keys":["launch.version","launch.configurations"]}
@vaaski
vaaski / assettoland.net.user.js
Created March 17, 2022 11:58
adds an "install in content manager" anchor to every car
// ==UserScript==
// @name Add direct content manager install links
// @description Add direct content manager install links
// @version 0.1
// @author vaaski
// @match http://assettoland.net/*
// @exclude http://assettoland.net/cars*
// @icon https://www.google.com/s2/favicons?sz=64&domain=assettoland.net
// @grant none
// ==/UserScript==
@vaaski
vaaski / createFileHash.ts
Created October 31, 2021 17:08
deno create file hash
const createHash = async (filename: string) => {
const file = await Deno.readFile(filename)
const hash = await crypto.subtle.digest("SHA-1", file)
const hashArray = Array.from(new Uint8Array(hash))
return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("")
}
@vaaski
vaaski / index.html
Created March 26, 2021 12:31
Stripe.com gradient animation
<html>
<head>
<title>Stripe Gradient</title>
</head>
<body>
<canvas id="gradient-canvas"></canvas>
<style>
html,
body {
margin: 0;
@vaaski
vaaski / print_aliases.mjs
Last active December 4, 2021 22:31
list all .bash_aliases pretty
#!/usr/bin/env node
// @ts-check
import { readFileSync } from "fs"
const aliases = readFileSync("/root/.bash_aliases", { encoding: "utf8" })
const dim = (/** @type string */ str) => `\x1b[2m${str}\x1b[0m`
const bright = (/** @type string */ str) => `\x1b[34m${str}\x1b[0m`
const lines = aliases.trim().split("\n")
@vaaski
vaaski / youtube-cleanup.user.js
Last active October 22, 2022 14:14
Clean up unnecessary YouTube UI junk
// ==UserScript==
// @name youtube cleanup
// @version 1
// @description cleans up youtube
// @author vaaski
// @match https://youtube.com/*
// @match https://*.youtube.com/*
// @grant none
// @run-at document-end
// @namespace https://gist.github.com/vaaski/b503fc9687776f09992bc604b82a035a
@vaaski
vaaski / getElement.js
Last active January 20, 2021 10:25
get an element with querySelector or wait for it using MutationObserver
/**
* get an element with querySelector or wait for it using MutationObserver
* @param {string} selector a css selector
* @param {HTMLElement} parent the parent in which to search for
* @returns {Promise<HTMLElement>}
*/
const getElement = (selector, parent = document) => {
return new Promise(res => {
let query = parent.querySelector(selector)
if (query) return res(query)