Skip to content

Instantly share code, notes, and snippets.

@valen214
valen214 / restart_explorer.ps1
Created October 21, 2025 14:12
restart windows explorer.exe from powershell with Windows Restart Manager API
# restart-explorer.ps1
# Restarts explorer.exe using Windows Restart Manager.
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
using System.Text;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
@valen214
valen214 / change-speed.js
Last active March 17, 2025 05:42
Force music video to 1.0x speed on yt
// ==UserScript==
// @name Github Gist: force music playing at 1.0x speed on yt load
// @namespace https://gist.github.com/valen214/7095b14e1d10c1289e524ee96049a35a
// @version 0.2
// @description force music playing at 1.0x speed on yt load
// @author Valen
// @run-at document-end
// @match http*://www.youtube.com/watch*
// @grant none
// ==/UserScript==
@valen214
valen214 / PromiseWebworker.ts
Last active August 4, 2022 08:40
Typed Promise Webworker
// https://stackoverflow.com/a/37154736/3142238
function sanitizeThis(self: any){
// @ts-ignore
// console.assert(this === self, "this is not self", this, self);
// 'this' is undefined
"use strict";
// ==UserScript==
// @name video helper
// @version 1
// @grant none
// @updateURL https://gist.github.com/valen214/0c9ddc51fccbb28c3da30ce914193ac1/raw/6e3ed5d4a36cb583f4b187ca2e83e9065047ddda/video_helper.user.js
//
// ==/UserScript==
/*
// @match https://www.youtube.com/*
@valen214
valen214 / questions.json
Last active January 5, 2020 11:41
high school programming question
{
"java": {
"1": {
"title": "Basic I/O - Console",
"questions": [
{
"type": "mc",
"question": "Which of the following is the correct package import statement so that the following line <br />\n<pre>\nScanner scanner = new Scanner(System.in);\n</pre>\ncan compile without error?",
"options": [
"import java/util/Scanner",
0x0Dc21E86B2d83788e014b52119Ef340D2aeb888E
@valen214
valen214 / C_CPP_JAVA_JS.txt
Last active June 4, 2017 19:00
comment block switch
/*
This is now comment
/*/
executable code
/*****/
//* added a '/' at the front