Skip to content

Instantly share code, notes, and snippets.

@tnhung2011
tnhung2011 / memreduct-onlogon.bat
Created December 7, 2025 15:53
Creates a task that runs Mem Reduct with administrative privileges on logon.
<!-- : Begin batch script
@echo off
setlocal enableextensions enabledelayedexpansion
(set lf=^
)
reg query HKEY_USERS\S-1-5-19\Environment /v TEMP >nul 2>nul || (
choice /M "Re-run the script as administrator?"
if errorlevel 2 goto :eof
mshta vbscript:Execute("CreateObject(""Shell.Application"").ShellExecute ""%~f0"", """", """", ""runas"", 1:code close"^)
@tnhung2011
tnhung2011 / brainfuck.bat
Last active November 19, 2025 13:56
A batchfile Brainfuck interpreter
<!-- :
@echo off
setlocal enableextensions enabledelayedexpansion
set sy32=%systemroot:\Windows%=%\System32
set "tempFile=%temp%\strlen-bf.tmp"
if "%~1" equ "" (
%sy32%\timeout /t 0 >nul 2>nul || (
1>&2 (
echo ERROR: Can't use input redirection. (this breaks the input stream^)
echo Please instead use the first argument to pass a script.
@tnhung2011
tnhung2011 / EnvShortcut.vbs
Created July 5, 2025 02:29
Creates a shortcut for convenient access to environment variables (could be placed in `Start Menu` folder)
Set h = WScript.CreateObject("WScript.Shell")
Set oLink = h.CreateShortcut(".\Environment Variables.lnk")
oLink.TargetPath = "%SystemRoot%\System32\rundll32.exe"
oLink.Arguments = "sysdm.cpl,EditEnvironmentVariables"
oLink.IconLocation = "%SystemRoot%\System32\shell32.dll,104"
oLink.Save
@echo off
prompt [$P]^
$$$S
@echo on
@tnhung2011
tnhung2011 / rocursor.bat
Last active September 1, 2025 09:34
A handy program for customizing your Roblox cursor (ANSI-encoded) (now a kludge for people who doesn't like Bloxstrap)
@echo off
setlocal
set stop=end
set __p=%systemroot%\System32\WindowsPowershell\v1.0\powershell.exe
2>nul >nul %__p% /?
if %errorlevel% neq 0 (
echo Unsupported OS.
goto %stop%
#include <stdio.h>
int main() {
for (char i = 0; i < 127; i++)
printf("%s", &i);
}
@tnhung2011
tnhung2011 / build_windows.yml
Last active September 10, 2023 13:16
Builds Tauri applications for Windows (x64, x86), then draft a release
name: Build executable
on: workflow_dispatch
env:
name: PLACE_REPO_NAME_HERE
CARGO_TERM_COLOR: always
jobs:
build:
@tnhung2011
tnhung2011 / README.md
Created August 30, 2023 09:15 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@tnhung2011
tnhung2011 / grabUnusedFiles.js
Last active July 12, 2023 02:00
Grab unused files on a page of Special:UnusedFiles
Array.prototype.forEach.call([].slice.call(document.querySelector("#gallery-0").childNodes, 1), function(elem) {
console.log(decodeURI(/(File:.+?)\?/gm.exec(elem.childNodes[0].href)[1]));
});
@tnhung2011
tnhung2011 / taskkiller.bat
Created August 29, 2022 01:05
A simple batch script to terminate background tasks
@echo off
set args=%*
if [%args%] EQU [] (
tasklist
set /p args=Taskname to kill:^
)
taskkill /f /im %args%