Skip to content

Instantly share code, notes, and snippets.

View Taraflex's full-sized avatar

Alexander Taratin Taraflex

View GitHub Profile
@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 June 30, 2024 00:05
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 <birunthan@mohanathas.com>
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 June 25, 2024 20:13
Hyperlinks in Terminal Emulators
@kkeybbs
kkeybbs / chrome_flags.updated.js
Last active February 5, 2024 07:47
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 June 27, 2024 15:13
Про токены, 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 January 17, 2024 12:15
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;
}
@princebot
princebot / random.bash
Created October 24, 2016 02:11
Generate a random string of characters with Bash.
# This reads a stream of random bytes from the system and drops input that isn’t
# a valid encoding for a letter or a number. It stops after 8 characters.
#
# Setting LC_CTYPE=C is important: Modern systems will (hopefully) be set to
# UTF-8, but that makes tr throw errors for illegal byte sequences. Usually, we
# want that kind of sane behavior — but here, we don’t.
LC_CTYPE=C tr -d -c '[:alnum:]' </dev/urandom | head -c 8
# This saves a 15-character alphanumeric string in a variable:
random=$(LC_CTYPE=C tr -d -c '[:alnum:]' </dev/urandom | head -c 15)
@sobolevnrm
sobolevnrm / ris.py
Created August 21, 2016 02:07
A very simple RIS file parser
""" Process RIS format following the standard at",
http://referencemanager.com/sites/rm/files/m/direct_export_ris.pdf """
import re
ALLOWED_TAGS = {"TY" : "Record start",
"ER" : "Record end",
"A2" : "Secondary author",
"A3" : "Tertiary Author",
"A4" : "Subsidiary Author",
"AB" : "Abstract",