Skip to content

Instantly share code, notes, and snippets.

View rc-chuah's full-sized avatar
💻
Programming In Progress

RC Chuah rc-chuah

💻
Programming In Progress
View GitHub Profile
@rc-chuah
rc-chuah / helloworld.ps1
Created January 9, 2021 14:33
Hello World In PowerShell.
Write-Host "Hello, World!"
@rc-chuah
rc-chuah / CheckAdmin.bat
Created April 13, 2021 07:16
Tool To Check Run As Administrator Using Batch File
@echo off
openfiles > nul 2>&1
if %ErrorLevel% equ 0 (
echo [+] Running As Administrator
) else (
echo [!] Not Running As Administrator
)
pause

Keybase proof

I hereby claim:

  • I am rc-chuah on github.
  • I am rc_chuah (https://keybase.io/rc_chuah) on keybase.
  • I have a public key whose fingerprint is E0E6 04AA F2C4 1709 5C9A 00F3 398A 22F9 68C0 1908

To claim this, I am signing this object:

@rc-chuah
rc-chuah / helloworld.nsi
Created November 25, 2021 12:41
This hello world script will create a popup box with the words "hello world" in it and an "OK" button, when the installer is run.
; Set the name of the installer
Outfile "Hello-World.exe"
; Create a default section.
Section
; Create a popup box, with an OK button and the text "Hello, World!".
MessageBox MB_OK "Hello, World!"
SectionEnd
@rc-chuah
rc-chuah / VersionInfo.nsi
Created November 25, 2021 12:44
This script shows you how to add version information to an installer.
; VersionInfo.nsi
;
; This script shows you how to add version information to an installer.
; Windows shows this information on the Version tab of the File properties.
;--------------------------------
Name "Version Info"
OutFile "VersionInfo.exe"
@rc-chuah
rc-chuah / FileVersionInfo.nsi
Created November 25, 2021 12:46
This script shows you how to add version information to an installer.
!define /date BUILD_YEAR "%Y"
!define PRODUCT_VERSION "${PRODUCT_MAJOR}.${PRODUCT_MINOR}.${PRODUCT_TIMESTAMP}.${PRODUCT_BUILD}"
!define PRODUCT_NAME "AwesomeProgram"
!define OUT_FILE_NAME "${PPRODUCT_NAME}_${PRODUCT_VERSION}_setup.exe"
;version info
VIProductVersion "${PRODUCT_VERSION}"
VIAddVersionKey "ProductName" "Awesome Program Installer"
VIAddVersionKey "OriginalFilename" "${OUT_FILE_NAME}"
VIAddVersionKey "CompanyName" "Awesomness Inc"
@rc-chuah
rc-chuah / helloworld.iss
Created November 25, 2021 14:05
This hello world script will create a popup box with the words "hello world" in it and an "OK" button, when the installer is run.
[Setup]
AppName=Hello World
AppVerName=Hello World 1
UsePreviousAppDir=false
DefaultDirName={autopf}\Hello World
Uninstallable=false
OutputBaseFilename=Hello-World
PrivilegesRequired=none
[Messages]
@rc-chuah
rc-chuah / helloworldloop.ps1
Created November 26, 2021 13:31
Hello World Loop In PowerShell.
while($true) {
Write-Host "Hello, World!"
}
@rc-chuah
rc-chuah / ClearScreen1.c
Created March 3, 2022 08:03
Clear Screen For Console Application
#include <windows.h>
void ClearScreen() {
COORD topLeft = { 0, 0 };
HANDLE hStdOut;
DWORD written;
CONSOLE_SCREEN_BUFFER_INFO screen;
DWORD dwConSize;
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hStdOut, &screen);
@rc-chuah
rc-chuah / ClearScreen2.c
Created March 3, 2022 09:36
Clear Screen For Console Application
#include <windows.h>
void ClearScreen() {
HANDLE hStdOut;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD count;
DWORD cellCount;
COORD homeCoords = { 0, 0 };
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
if (hStdOut == INVALID_HANDLE_VALUE)