Skip to content

Instantly share code, notes, and snippets.

@tnhung2011
tnhung2011 / brainfuck.bat
Last active September 2, 2025 03:34
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%
@tnhung2011
tnhung2011 / APLIAFCLDTCITAMPAC.lua
Last active January 20, 2024 19:20
Simple implementation of the "A programming language is any set of rules that converts strings, or graphical program elements in the case of visual programming languages, to various kinds of machine code output." (abbreviated Programming Language or APLIAFCLDTCITAMPAC) programming language.
valid_string = 'A programming language is any set of rules that converts strings, or graphical program elements in the case of visual programming languages, to various kinds of machine code output.'
function file_exists(file)
local f = io.open(file, 'rb')
if f then f:close() end
return f ~= nil
end
function parse(command)
if command == valid_string then