Skip to content

Instantly share code, notes, and snippets.

View Taraflex's full-sized avatar

Alexander Taratin Taraflex

View GitHub Profile
choco list --limit-output
# Extract name and find corresponding winget package
| ForEach-Object -Parallel {
$chocoName = $_.Split('|')[0]
Get-WinGetPackage $chocoName -Count 1 |% {
@{
'chocoName' = $chocoName
'wingetPackage' = $_.Name
}
}
@seanmiddleditch
seanmiddleditch / cplusplus-enum-members.md
Last active November 25, 2024 11:16
Meta-Proposal for Enum Member Functions

Meta-Proposal for Enum Member Functions

Problem

Enums today cannot provide any custom behavior via member functions. Behavior for enumeration types must be provided by traits classes or namespace-scope operator overloads and functions.

For some uses of enums, such as opaque ID wrapper or flags types, the inability to introduce hidden friend functions poisons the namespace scope of the enum (resulting in worse diagnostic and build times). Typically, custom operations and extension points should be defined as hidden friends to improve the experience of C++ developers using the type.

Consider:

@WestonThayer
WestonThayer / instructions.md
Created August 9, 2019 01:01
App to get Windows scancodes

How to compile

On a Windows machine, you'll first need Visual Studio (the free version is fine). Once that's complete:

  1. Open a command prompt
  2. Find vcvarsall.bat in your VS installation path, then call it with x64 as it's argument. It will look something like: call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x64
  3. Run cl main.c -nologo -Zi -link user32.lib

That should compile and generate main.exe.

@fnky
fnky / ANSI.md
Last active December 20, 2025 20:02
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@poiru
poiru / node-windows-silent.patch
Created February 2, 2018 05:23
Patch to make Node 8.9.x run silently without popping up the console window and without triggering the spinning feedback cursor. See https://github.com/nodejs/node/issues/556
commit 1d685613e455017043d4371b3124eca997357eaa
Author: Birunthan Mohanathas <[email protected]>
Date: Fri Feb 2 10:46:54 2018 +0530
node: generate a Windows application instead of a console application
This makes Node run silently without popping up a console window and
without triggering the spinning feedback cursor.
diff --git a/deps/uv/src/win/handle-inl.h b/deps/uv/src/win/handle-inl.h
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active December 15, 2025 10:16
Hyperlinks in Terminal Emulators
@kkeybbs
kkeybbs / chrome_flags.updated.js
Last active May 29, 2025 21:31
Backup chrome flags to json and restore the backup on another machine.
// 2022-04-03, tested with Chrome 99.0.4844.84 on MacBook Pro m1
/*
Open chrome://flags/
F12 open developer console, swtich to tab "Console"
Paste below codes
- input backup() to download flags backup file
- input restore() to select one backup to restore
*/
function saveFile(filename, data) {
@zmts
zmts / tokens.md
Last active December 19, 2025 07:20
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@kripken
kripken / hello_world.c
Last active March 19, 2025 06:14
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@mattia-beta
mattia-beta / security.conf
Created December 30, 2016 16:20
NGINX Security Config
## Block SQL injections
set $block_sql_injections 0;
if ($query_string ~ "union.*select.*\(") {
set $block_sql_injections 1;
}
if ($query_string ~ "union.*all.*select.*") {
set $block_sql_injections 1;
}