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 <iostream> | |
#include <utility> | |
using namespace std; | |
enum class request_type { | |
GET, | |
POST, | |
PUT, | |
DELETE, | |
OPTIONS, | |
}; |
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
(function () { | |
const UTF8_SIGNIFICANT_BITS_SIZE = 7; | |
const BITS_IN_BYTE = 8; | |
globalThis.setChar = function (char, excludeCharacters) { | |
if (typeof excludeCharacters === 'string') { | |
return setChar(char, Array.prototype.map.call(excludeCharacters, c => c.charCodeAt(0))); | |
} | |
if (typeof char === 'string') { | |
if (char.length !== 1) { |
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
// http://burnignorance.com/vc-application-development-tips/hooking-a-message-box-in-vc/ | |
HHOOK hMsgBoxHook; | |
LRESULT CALLBACK MsgBoxProc(int nCode, WPARAM wParam, LPARAM lParam) | |
{ | |
TCHAR ach[140]; | |
HWND hwnd; | |
HWND YES; | |
HWND NO; | |
HWND CANCEL; |
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
type Dec<Length extends number, Acc extends never[] = []> = | |
[never, ...Acc]['length'] extends Length ? Acc['length'] : | |
Dec<Length, [never, ...Acc]>; | |
type MakeRange<TMin extends number, TMax extends number, Acc extends number = never> = | |
TMax extends TMin ? TMax | Acc | |
: MakeRange<TMin, Dec<TMax>, TMax | Acc>; | |
type TupleBaseType = readonly any[] & { length: MakeRange<1,10> } | |
/** | |
* generate this code with: | |
* ======================= |
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 { Func } from "@rhombus-toolkit/func"; | |
type Func<Args extends any[], Result = void> = (...args: Args) => Result; | |
type AnyRecord = Record<string|symbol, any>; | |
type AnyFunction = (...args: any[]) => any; | |
type MakeBuilder<T extends AnyRecord> = | |
T extends infer a extends AnyRecord | infer b extends AnyRecord ? ObjectBuilder<a> | ObjectBuilder<b> : ObjectBuilder<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://github.com/chocolatey/choco/blob/0.10.15/src/chocolatey.resources/redirects/RefreshEnv.cmd | |
@echo off | |
:: | |
:: RefreshEnv.cmd | |
:: | |
:: Batch file to read environment variables from registry and | |
:: set session variables to these values. | |
:: | |
:: With this batch file, there should be no need to reload command |
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
#!/bin/bash | |
# chmod +x ./enable-rdp.sh | |
sudo apt install xrdp | |
sudo systemctl enable --now xrdp | |
sudo ufw allow from any to any port 3389 proto tcp | |
sudo ufw allow from any to any port 3399 proto tcp |
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://github.com/RobTillaart/Arduino/blob/master/libraries/Complex/complex.cpp | |
function format(real, imag){ | |
if(this.imag == 0){ | |
return real | |
} | |
if(real == 0){ | |
return 'i' + imag; | |
} | |
return `${real} ${imag < 0 ? `-` : `+`} ${Math.abs(imag)}i`; |
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
<html> | |
<head> | |
<title>IT Tasks for Users</title> | |
<HTA:APPLICATION | |
APPLICATIONNAME="IT Tasks for Users" | |
ID="IT Tasks for Users" | |
VERSION="1.0"/> | |
<STYLE></STYLE> |
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
// http://arc.id.au/Spectrogram.html | |
const [Waterfall, Rasterscan] = (function () { | |
Waterfall = function (ipBufAry, w, h, dir, options) { | |
var direction = typeof dir === "string" ? dir.toLowerCase() : "down"; | |
switch (direction) { | |
case "up": | |
return new Spectrogram(ipBufAry, w, h, "WF", false, true, options); | |
case "down": |
NewerOlder