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 / open-source-licenses.md
Created August 15, 2025 19:24
Open-Source Licenses

TL;DR - The BSD 3 Clause License Should Do

If you're publishing a piece of code that you want to distribute as much as possible, maybe having other people helping you with the code, making sure you're not going to be sued as well as making sure that your name or your company's name are not going to be used by others without your approval, then the BSD 3 clause license is just what you're after. You can find it at the bottom of this document.

To apply the BSD license to your code:

  1. Create a new LICENSE file at the root of your project, and paste the license there (copy at the bottom of this document).

  2. At the beginning of all of your source code file, paste this:

    Copyright (c) <year>, <copyright holder>
    

All rights reserved.

@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