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 ABSEILINLINEDVECTOR__H__ | |
#define ABSEILINLINEDVECTOR__H__ | |
#include <algorithm> | |
#include <cassert> | |
#include <climits> | |
#include <cstddef> | |
#include <cstdlib> | |
#include <cstring> | |
#include <initializer_list> |
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 APPEND_UNESCAPED_JSON_STRING__HPP__ | |
#define APPEND_UNESCAPED_JSON_STRING__HPP__ | |
// | |
// usage: | |
// | |
// const char json[] = u8"유티엪후-8! XYZ, \\uAC00, \\uD600\\uc5c9, QVW \\u0X 유티엪후-8!, 써로게이트 \\uD83D\\uDCA9 페어!"; | |
// const auto json_length = strlen(json); | |
// std::string s; | |
// append_unescaped_json_string(json, json_length, [&s](auto c) { |
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 "jsmn.h" | |
struct JSMN_Verify_Stack_Element | |
{ | |
int offset; | |
int num_tokens; | |
}; | |
int JSMN_Verify(const jsmntok_t* tokens, const JSMN_Verify_Stack_Element param) | |
{ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> | |
<Type Name="absl::lts_2019_08_08::InlinedVector<*>"> | |
<DisplayString>{{ size={storage_.metadata_.value >> 1} }}</DisplayString> | |
<Expand> | |
<Item Name="[N]" ExcludeView="simple">sizeof(storage_.data_.inlined.inlined_data) / sizeof(storage_.data_.inlined.inlined_data[0])</Item> | |
<Item Name="[allocator]" ExcludeView="simple">storage_.metadata_</Item> | |
<Item Name="[capacity]" ExcludeView="simple" Condition="(storage_.metadata_.value & 1) == 0">$T2</Item> | |
<Item Name="[capacity]" ExcludeView="simple" Condition="(storage_.metadata_.value & 1) == 1">storage_.data_.allocated.allocated_capacity</Item> | |
<IndexListItems Condition="(storage_.metadata_.value & 1) == 0"> |
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')), |
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
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
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
#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
#ifndef GETEXEMODULEPATH__HPP__ | |
#define GETEXEMODULEPATH__HPP__ | |
#if !defined(_WINDOWS_) && !defined(__AFX_H__) | |
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#endif | |
#include <string> |