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
template<typename T> | |
class AsyncType { | |
protected: | |
std::mutex typeMutex; | |
T typeValue; | |
public: | |
const std::mutex& TypeMutex = typeMutex; | |
T Get() { |
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
class EepromSlice { | |
protected: | |
EERef* eepromReferences; | |
size_t referenceCount; | |
public: | |
const size_t& Size = referenceCount; | |
EERef At(const size_t& index) { | |
if(index < Size) { |
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
template<typename> | |
class LambdaObject; | |
template<typename LambdaReturnType, typename... LambdaArguments> | |
class LambdaObject<LambdaReturnType(LambdaArguments...)> { | |
protected: | |
struct AbstractLambdaContainer { | |
virtual LambdaReturnType Call(LambdaArguments...) = 0; | |
virtual AbstractLambdaContainer* ReturnContainerCopy() = 0; | |
virtual ~AbstractLambdaContainer() {} |
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
std::string CaesarCipher(std::string string, int shift) { | |
std::transform(string.begin(), string.end(), string.begin(), [&shift](char character) -> char { | |
char head_character = (character >= 'A' && character <= 'Z') ? 'A' : ((character >= 'a' && character <= 'z') ? 'a' : '\0'); | |
return head_character ? (head_character + (((character - head_character) + shift) % 26)) : character; | |
}); | |
return string; | |
} |
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
(defun get-char-case (input-char) | |
(cond ((and (>= (char-code input-char) 65) (<= (char-code input-char) 90)) 'uppercase) | |
((and (>= (char-code input-char) 97) (<= (char-code input-char) 122)) 'lowercase))) | |
(defun alphabet-start (input-char) (let ((casing (get-char-case input-char))) | |
(if input-char (cond ((eq casing 'lowercase) 97 ) ((eq casing 'uppercase) 65)) nil))) | |
(defun caesar-shift-character (input-char shift-amount) | |
(if (alphabet-start input-char) | |
(code-char (+ (alphabet-start input-char) (mod (+ (- (char-code input-char) (alphabet-start input-char)) shift-amount) 26))) |
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
(setq expression2-font-lock-keywords | |
(let* ( | |
;; define several category of keywords | |
(e2-directives '("#include" "@name" "@inputs" "@outputs" "@persist" "@trigger" "@model" "@autoupdate")) | |
(e2-directives-regexp (regexp-opt e2-directives)) | |
(e2-keywords '("if" "else" "elseif" "switch" "while" "for" "foreach" "continue" "break" "local")) | |
(e2-keywords-regexp (regexp-opt e2-keywords 'words)) | |
(e2-types '("string" "number" "vector" "entity" "angle" "array" "table")) |
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
' I hate VBS, but it's suitable for this. | |
' Can be tested by opening notepad then invoking: background taskkill /im notepad.exe | |
Set oShell = CreateObject ("Wscript.Shell") | |
Set args = Wscript.Arguments | |
Dim strArgs | |
strArgs = "cmd /c " | |
For Each arg in args |
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
class AutoRefreshingOAuthToken | |
def request_new_token | |
endpoint_uri = URI.parse('https://id.twitch.tv/oauth2/token') | |
endpoint = Net::HTTP.new(endpoint_uri.host, endpoint_uri.port) | |
endpoint.use_ssl = true | |
request = Net::HTTP::Post.new(endpoint_uri.path) | |
post_form_data = { |
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 <functional> | |
#include <algorithm> | |
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <vector> | |
#include <thread> | |
#include <atomic> | |
#include <mutex> |
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
# Default SSH Server Config Dir: C:\ProgramData\ssh | |
# Default SSH Client Config Dir: C:\Users\USERNAME\.ssh\ | |
# sshd Binaries should be stored in C:\Program Files\ | |
# And the folder permissions must be free from inherited permissions | |
# authorized users should have read/exec access, and admin/system should have full, | |
# otherwise the daemon might break. | |
# Bypass execution policy and run sshd installation script. | |
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1 |
OlderNewer