This file contains 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
//Thanks @_can1357 for help with this. | |
#include <type_traits> | |
#include <tuple> | |
#include <utility> | |
template<typename T, typename = void> | |
struct callback_type { using type = T; }; | |
template<typename T> |
This file contains 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
// https://www.reddit.com/r/programming/comments/gnazif/ray_tracing_in_notepadexe_at_30_fps/ | |
static void nlog(char *str, ...) | |
{ | |
HWND notepad, edit; | |
va_list ap; | |
char buf[256]; | |
va_start(ap, str); | |
vsprintf(buf, str, ap); | |
va_end(ap); |
This file contains 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
# make a key | |
gpg --full-generate-key | |
# make it > 4096 | |
gpg --list-secret-keys --keyid-format LONG | |
# key id is numbers on asc line after / | |
gpg --armor --export <key id> | |
# add to github | |
git config --global user.signingkey <key id> |
This file contains 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
# Windows powerline fonts install (OR https://github.com/microsoft/cascadia-code/releases?WT.mc_id=-blog-scottha <<- PREFER THIS) | |
git clone https://github.com/powerline/fonts.git | |
cd fonts | |
Set-ExecutionPolicy Bypass | |
./install.ps1 | |
Set-ExecutionPolicy Default | |
sudo apt-get update && sudo apt-get upgrade | |
sudo apt-get install zsh curl git | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
This file contains 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 <iomanip> | |
#include <iostream> | |
#include <vector> | |
#include <termcolor.hpp> | |
void hexDump(const std::vector<uint8_t>& bytes, std::ostream& stream) | |
{ | |
char buff[17]; | |
size_t i = 0; |
This file contains 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
// goto radarr->settings->general then paste this. | |
const key = document.getElementsByClassName('x-api-key')[0].value; | |
if (!key) { | |
alert('Navigate to /settings/general and run again'); | |
} | |
let ids = []; | |
let _movies = []; | |
let index = 0; |
This file contains 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
import sys | |
import os | |
with open(sys.argv[1]) as f: | |
lines = f.readlines() | |
for line in lines: | |
stripped = line.strip() | |
fixed = stripped.replace(',', "").replace(':','').replace(' - ', ' ').replace('-',' ').replace('.','').replace('&','and').replace('\'','').replace('!','') | |
folder = os.path.join(sys.argv[2], fixed) |
This file contains 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
By maamountki | |
#include <Windows.h> | |
#include <DbgHelp.h> | |
#include <stdio.h> | |
#pragma comment(lib, "dbghelp.lib") | |
BOOL CALLBACK EnumProc(SYMBOL_INFO* info, ULONG size, void* param) | |
{ |
This file contains 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
https://www.unknowncheats.me/forum/c-and-c-/307336-compile-time-pattern.html | |
#include <type_traits> | |
#include <algorithm> | |
#include <cstdint> | |
constexpr std::uint8_t parse_hex(char c) { | |
if (c >= '0' && c <= '9') return c - '0'; | |
if ((c | 32) >= 'a' && (c | 32) <= 'f') return (c | 32) - 'a' + 10; | |
if (c == '?') return 0; |
This file contains 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
#!/usr/bin/env python | |
from socket import AF_INET, SOCK_DGRAM | |
from datetime import datetime | |
import sys | |
import socket | |
import struct, time | |
def getNTPTime(host = "pool.ntp.org"): |