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 "CircularBuffer.h" | |
#include <climits> | |
#include <cassert> | |
#include <algorithm> | |
CircularBuffer::CircularBuffer() = default; | |
CircularBuffer::~CircularBuffer() = default; | |
CircularBuffer::CircularBuffer(void* buffer_address, size_t length) |
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 <cstring> | |
#include <algorithm> | |
#include <utility> | |
#include <string> | |
#include <regex> | |
template<typename C> class EncodeCodePointToUTF { | |
public: | |
C encoded[(4 / sizeof(C)) + 1] = {}; | |
int length = 1; |
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 <io.h> | |
#include <fcntl.h> | |
#include <Windows.h> | |
auto open_file_for_read_alow_delete(const wchar_t filename[]) { | |
struct result { | |
FILE* fp; | |
long long size; | |
int error; | |
}; |
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
#define NOMINMAX | |
#include <fcntl.h> | |
#include <io.h> | |
#include <clocale> | |
#include <cstdio> | |
#include <vector> | |
#include <algorithm> |
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
#ifndef GETEXEMODULEPATH__HPP__ | |
#define GETEXEMODULEPATH__HPP__ | |
#if !defined(_WINDOWS_) && !defined(__AFX_H__) | |
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#endif | |
#include <string> |
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
#ifndef ANONYMOUSPIPE__HPP__ | |
#define ANONYMOUSPIPE__HPP__ | |
#if !defined(_WINDOWS_) && !defined(__AFX_H__) | |
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#endif | |
#include <cstdlib> | |
#include <cstdio> |
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-RegistryValue | |
{ | |
param | |
( | |
[parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Path, | |
[parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Value | |
) | |
if (Test-Path $Path) | |
{ |
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
param ( | |
[Parameter(Mandatory=$true)][string]$Uri, | |
[string]$DownloadDir, | |
[string]$ExtractDir, | |
[string]$DownloadFilePath | |
) | |
$invocation_dir = Split-Path $MyInvocation.MyCommand.Path | |
$response = Invoke-WebRequest -Uri $Uri -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox | |
$response_path = $response.BaseResponse.ResponseUri.AbsolutePath.Split('/') |
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
extern "C" | |
{ | |
__declspec(dllexport) int NvOptimusEnablement = 1; | |
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; | |
} |
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-AliasPattern($exe) { | |
$aliases = @($exe) + @(Get-Alias | Where-Object { $_.Definition -eq $exe } | Select-Object -Exp Name) | |
"($($aliases -join '|'))" | |
} | |
$options = @( | |
@(@('-A', '--after-context'), @('<NUM>')), | |
@(@('-B', '--before-context'), @('<NUM>')), | |
@(@('-S', '--case-sensitive'), @()), | |
@(@('', '--color'), @('never', 'auto', 'always', 'ansi')), |
OlderNewer