Skip to content

Instantly share code, notes, and snippets.

@lanior
lanior / launcher.cpp
Last active January 23, 2020 11:51
A very simple Warcraft 3 launcher which allows to run multiple copies of the game. Written about a year ago.
#include <windows.h>
#include <psapi.h>
#include <tchar.h>
#include "Shlwapi.h"
#include <cstdlib>
struct GameVersion
{
int lo, hi;
@shadowfox
shadowfox / ArgumentParser.cs
Created June 23, 2013 08:23
Utility class for parsing command line arguments
using System;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
namespace Utilities
{
/// <summary>
/// ArgumentParser class
/// Intelligent handling of command line arguments based on Richard Lopes' (GriffonRL's)
/// class at http://www.codeproject.com/Articles/3111/C-NET-Command-Line-Arguments-Parser
@ashelly
ashelly / getopt.c
Last active November 9, 2023 23:22
"Port of GNU getopt() to Win32 for anyone who's tired of dealing with getopt() calls in Unix-to-Windows ports." Ported by Pete Wilson. Recovered from the Internet Archive's snapshot of www.pwilson.net/sample.html.
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@mgronhol
mgronhol / fast-str.c
Last active April 6, 2024 14:48
Fast string compare
int fast_compare( const char *ptr0, const char *ptr1, int len ){
int fast = len/sizeof(size_t) + 1;
int offset = (fast-1)*sizeof(size_t);
int current_block = 0;
if( len <= sizeof(size_t)){ fast = 0; }
size_t *lptr0 = (size_t*)ptr0;
size_t *lptr1 = (size_t*)ptr1;
@Manu343726
Manu343726 / cowbasic_string.hpp
Last active November 15, 2023 17:44
(conceptual) COW string implementation
/*
* A simple Copy On Write (COW) string implementation.
*
* Copyright © 2014 Manu Sanchez. @Manu343726 on GitHub, Stack Overflow, etc.
*
* manu343726.github.io
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
@absynce
absynce / DisableChromeUpdates.ps1
Created February 4, 2015 21:23
Disable Chrome updates in Windows via the registry.
# *******************************************
#
# Mod by: Jared M. Smith
# Mod on: 2015.01.14
# Mod y?: Disable Google Chrome updates.
#
# *******************************************
# Log method
function Log { Param([string]$message) Write-Host $message; }
@0XDE57
0XDE57 / config.md
Last active July 7, 2024 00:25
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@ssfang
ssfang / NtQueryInformationProcess.cpp
Last active January 23, 2020 11:51
Get N level parent process id
//#include <stdio.h>
#include <io.h>
#include <fcntl.h>
//#include <windows.h>
//typedef LONG (__stdcall *FPTR_NtQueryInformationProcess) (HANDLE, INT, PVOID, ULONG, PULONG);
//FPTR_NtQueryInformationProcess NtQueryInformationProcess;
// Retrieve function address from DLL
//NtQueryInformationProcess = (FPTR_NtQueryInformationProcess) GetProcAddress(GetModuleHandle("ntdll"), "NtQueryInformationProcess");
//if (NtQueryInformationProcess == NULL) {
@MrYar
MrYar / Firefox-68
Last active July 4, 2024 22:52 — forked from haasn/about:config.md
Firefox telemetry and spy removal
// Turn off "Sends data to servers when leaving pages"
user_pref("beacon.enabled", false);
// Prevention of some telemetry related to the newtab
user_pref("browser.newtabpage.directory.ping", "");
user_pref("browser.newtabpage.directory.source", "");
user_pref("browser.newtabpage.enhanced", false);
// "In the release channels the Mozilla location service is used to help in figuring out regional search defaults."
// Which means sending collectable data