Skip to content

Instantly share code, notes, and snippets.

View end2endzone's full-sized avatar

Antoine Beauchamp end2endzone

View GitHub Profile
@end2endzone
end2endzone / backup_explorer_directories.bat
Last active November 9, 2023 01:30
This script backup the directory of all explorer.exe windows. For installation, create a shortcut to the script and place it in `shell:startup` directory. Press CTRL+C to stop the script execution.
@echo off
:: This script backup the directory of all explorer.exe windows.
:: For installation, create a shortcut to the script and place it in `shell:startup` directory.
:: Press CTRL+C to stop the script execution.
::
:: Usage:
:: backup_explorer_directories.bat [DELAY] /NO_RESTORE
::
:: DELAY: The delay between backups in seconds.
@end2endzone
end2endzone / ffmpeg_demux.bat
Last active January 11, 2024 00:06
Batch file for demuxing audio files using ffmpeg. Drag and drop files over the batch file to use or specify each files on the command line. ffmpeg must be in your PATH. For example, get the actual audio codec stream from a *.webp or *.mkv or *.m4a. The script automatically detects the internal audio codec and finds the associated file extension.
@echo off
:: Process all drag and drop files
if [%1]==[] goto :eof
:loop
call :demux "%~1"
shift
if not [%1]==[] goto loop
:: Pause at the end of processing all files.
{
"schemaVersion": 1,
"namedLogo": "Linux",
"logoColor": "white",
"label": "tests",
"color": "#4c1",
"message": "6 passed"
}
@end2endzone
end2endzone / GitHubURLstructures.md
Created January 3, 2019 17:20
Different URL constructs for documents hosted on GitHub's platform

GitHub URL structures

The following document shows how to create different kind of links (URL) to documents hosted on GitHub's.

The examples are based on a document hosted in end2endzone/RapidAssist repository. The path to the document inside the repository is: src/rapidassist/filesystem.cpp.

Urls

@end2endzone
end2endzone / force_crlf.vbs
Last active April 24, 2019 11:20
Force EOL to CRLF on Windows with this Visual Basic Script.
'Define the list of accepted file extensions
Set extensions = New List
extensions.Add( "h" )
extensions.Add( "hpp" )
extensions.Add( "cpp" )
extensions.Add( "txt" )
extensions.Add( "md" )
extensions.Add( "bat" )
extensions.Add( "cmd" )
extensions.Add( "ps1" )
@end2endzone
end2endzone / patch.bat
Last active October 18, 2018 11:44
Apply and create unified-diff patches in windows command line with this batch file (depends on subversion).
@echo off
REM Description:
REM The following script allows one to create patches in unified-diff format by comparing an old file (base file) with a new version of the file.
REM The script works by creating a temporary subversion repository. It commits the old file into the repository and update the local file with the new version. Using svn.exe, it creates a patch file for the changes.
REM The same steps are also executed for applying a patch. A temporary repository is created. The old file is committed into the repository and the patch is applied locally with svn.exe. The updated file is copied back to the user-desired destination and the temporary repository is deleted.
REM Note that the script is written for windows and have a dependency to subversion (svn.exe).
REM References:
REM https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490909(v=technet.10)
@end2endzone
end2endzone / FontSizeExport.cs
Created August 16, 2018 16:49
A C# class for quickly exporting the dimentions of all characters of a specific font to a c++ header file. Prevents c++ project to have a dependency on FreeType.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace WindowsFormsApplication1
{
class FontSizeExport
{
@end2endzone
end2endzone / print_target_properties.cmake
Created August 3, 2018 17:05
CMake script to print all properties of a given target. Useful for debugging exported or imported library properties. Inspired from https://stackoverflow.com/questions/32183975/how-to-print-all-the-properties-of-a-target-in-cmake
# Inspired from https://stackoverflow.com/questions/32183975/how-to-print-all-the-properties-of-a-target-in-cmake
# Get all propreties that cmake supports
execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST)
# Convert command output into a CMake list
STRING(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
STRING(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
# Prints the given property of the given target.