Skip to content

Instantly share code, notes, and snippets.

View lazuee's full-sized avatar
:shipit:
Lazuee

John Marlo Lapiz lazuee

:shipit:
Lazuee
View GitHub Profile
@lazuee
lazuee / secret-token.ts
Created July 12, 2025 06:24
Secret Token
import { Buffer } from "node:buffer";
import crypto from "node:crypto";
type Payload = {
ts: number;
salt: string;
};
type EncodedPayload = {
iv: string;
@lazuee
lazuee / source-map.ts
Created June 20, 2025 11:12
Parcel SourceMap
import $SourceMap from '@parcel/source-map';
import * as ParcelSourceMap from '@parcel/source-map';
export const SourceMap = (typeof $SourceMap === 'function'
? $SourceMap
// eslint-disable-next-line
: typeof ($SourceMap as any).default === 'function'
// eslint-disable-next-line
? ($SourceMap as any).default
: (typeof ParcelSourceMap === 'function'
@lazuee
lazuee / mysql-repair.bat
Created April 30, 2025 16:11
xampp mysql repair
@echo off
REM Change directory to the MySQL directory
cd /d "C:\xampp\mysql"
REM Backup old data
rename "data" "data_old"
REM Create new data directory
xcopy "backup" "data" /E /I
rmdir /S /Q "data\test"
@lazuee
lazuee / winget-install-[jdk-jre].ps1
Created March 5, 2025 13:49
Winget: Install EclipseAdoptium JDK/JRE
$targetVersion = "23"
$ids = winget search EclipseAdoptium.Temurin | Where-Object { $_ -match "$targetVersion." } | ForEach-Object { [regex]::Match($_,'((EclipseAdoptium\.Temurin\.[\d]{1,2})\.(?=JDK|JRE)\S+)').Value }
$ids | ForEach-Object { winget install -e --id $_ }
@lazuee
lazuee / winget-install-vcredist-aio.ps1
Created February 15, 2025 17:30
Winget: Install Visual C++ Redistributable Runtimes AIO
$arch = ((systeminfo | findstr /C:"System Type") -replace 'System Type:\s*', '' -split '-')[0].Trim().ToLower()
$ids = winget search Microsoft.VCRedist | Where-Object { $_ -match $arch } | ForEach-Object { [regex]::Match($_,'(Microsoft\.VCRedist\S+)').Value }
$ids | ForEach-Object { winget install -e --id $_ }
@lazuee
lazuee / config.ts
Created January 24, 2025 12:38
Load configuration file
import { loadConfigFile } from "./load";
const { config } = await loadConfigFile("custom.config"); // custom.config.(?:json|[cm]?[tj]s)
console.log(config);
@lazuee
lazuee / remove-invalid-deployments.sh
Created January 13, 2025 17:28
Remove deployment for non-existent commits
#!/bin/bash
OWNER="lazuee"
REPO="react-router"
BRANCH="main"
deployment_shas=$(gh api repos/$OWNER/$REPO/deployments --jq '.[].sha')
existing_shas=$(gh api repos/$OWNER/$REPO/commits?sha=$BRANCH --jq '.[].sha')
for deployment_sha in $deployment_shas; do
@lazuee
lazuee / discord-quest.js
Last active April 24, 2025 05:04
Complete the Discord quest by running this code on the browser console. (Use Vencord Web / Vesktop)
(() => {
if (typeof Vencord === "undefined") return console.log("You need to run this on (Vencord Web/Vesktop) app to continue...");
let ApplicationStreamingStore = Vencord.Webpack.findStore("ApplicationStreamingStore");
let RunningGameStore = Vencord.Webpack.findStore("RunningGameStore");
let QuestsStore = Vencord.Webpack.findStore("QuestsStore");
let ChannelStore = Vencord.Webpack.findStore("ChannelStore");
let GuildChannelStore = Vencord.Webpack.findStore("GuildChannelStore");
let { FluxDispatcher, RestAPI } = Vencord.Webpack.Common;
const quest = [...QuestsStore.quests.values()].find((q) => q.userStatus?.enrolledAt && !q.userStatus?.completedAt && new Date(q.config.expiresAt).getTime() > Date.now());
@lazuee
lazuee / adobe-killer.ps1
Last active June 8, 2025 16:49
Stop adobe running in the background and Block adobe in Host File
Function Priority {
$ErrorActionPreference = 'SilentlyContinue'
foreach ($root in 'HKCU', 'HKLM', 'HKU', 'HKCR') {
New-PSDrive -PSProvider Registry -Name $root -Root "HKEY_$root" | Out-Null
}
Set-ExecutionPolicy RemoteSigned -Force -Scope CurrentUser
$ErrorActionPreference = 'Continue'
}
Priority
@lazuee
lazuee / reimport.mjs
Created September 26, 2024 18:39
ESM import cache busting
import * as fs from "node:fs";
import * as path from "node:path";
let build = await reimport(path.resolve("build/index.js"));
export async function reimport(path) {
const stat = fs.statSync(path);
// convert build path to URL for Windows compatibility with dynamic `import`
const BUILD_URL = url.pathToFileURL(path).href;