This is a gist where you can find handy Python Functions for your projects!
Feel free to use them! ;D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set JVMArguments=-Xms3072m -Xmx3072m | |
if '%~1'=='1.7' set Version=7.10 | |
if '%Version%'=='7.10' goto :1.7 | |
if '%~1'=='1.8' set Version=8.9 | |
if '%Version%'=='8.9' goto :1.8 | |
if '%~1%'=='1.12' set Version=1.12 | |
if '%Version%'=='1.12' goto :1.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wmi import WMI | |
from os import getpid | |
pid = getpid() | |
Win32_Process = WMI().Win32_Process() | |
conhost = () | |
is_conhost = False | |
def process_traceback(pid: int): | |
processes, length = (), [None, None] | |
while True: | |
length[0] = len(processes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set __COMPAT_LAYER=RunAsInvoker | |
choice.exe /N /C YN /M "Elevate? (Y/N?) > " | |
if %errorlevel% == 1 ( | |
echo Elevation Granted! | |
start /b %* | |
exit /b 0 | |
) else ( | |
if %errorlevel% == 2 ( | |
echo Elevation Denied! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
char *strcmb(char *str1, char *str2, char *str3, char *str4) | |
{ | |
// Combines and puts the combined string in memory. | |
char *str = (char *)malloc(strlen(str1) + strlen(str2) + strlen(str3) + strlen(str4) + 1); | |
sprintf(str, "%s%s%s%s", str1, str2, str3, str4); | |
return str; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-SteamPath { | |
# Get the Steam installation directory. | |
# MUICache | |
$muicache = "Registry::HKCR\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" | |
$protocol = "Registry::HKCR\steam\Shell\Open\Command" | |
# MUICache | |
$steam = Split-Path (((Get-Item $MuiCache).Property | Where-Object {$PSItem -Like "*Steam*"} | Where-Object {(Get-ItemPropertyValue $MuiCache -Name $PSItem) -eq "Steam"}).TrimEnd(".FriendlyAppName")) | |
# Steam Browser Protocol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import winim | |
import os | |
const | |
tsz = 4 | |
fsz = 0 | |
let cmdline = commandLineParams() | |
var | |
t = true |
Nim Fork of ZetaLoader.
Build:
-
main.nim
nim c -d:release --app:gui -o:"ZetaLoader.exe" main.nim
-
dll.nim
I wanted to see if there was any benefit of making Desktop Window Manager entirely idle when its running.
Which includes settings its thread priorities and process priority to idle.
So feel free to test this.
You can build this project using GCC:
gcc -mwindows -s dwmidle.c -lWtsapi32 -o "DWMIdle.exe"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <wininet.h> | |
#include <libgen.h> | |
int main(__attribute__((unused)) int argc, char *argv[]) | |
{ | |
SetCurrentDirectory(dirname(argv[0])); | |
while (!InternetGetConnectedState(NULL, 0)) | |
Sleep(1); | |
// Steam Command Line Parameters: https://developer.valvesoftware.com/wiki/Command_Line_Options |
OlderNewer