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
pub mod md5 { | |
use std::convert::TryInto; | |
use std::fmt::Display; | |
use std::{fs::File, io::Read}; | |
pub const BLOCK_LENGTH: usize = 64; | |
pub const DIGEST_LENGTH: usize = 16; | |
#[rustfmt::skip] | |
pub const INITIAL_STATE: [u32; 4] = [ |
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
pub fn extract(input: &str, pattern_start: &str, pattern_end: &str) -> Vec<String> { | |
let mut matches = Vec::new(); | |
let mut position = 0; | |
while let Some(match_index) = input[position..].find(pattern_start) { | |
let start_index = position + match_index; | |
position = start_index + pattern_start.len(); | |
if let Some(match_index) = input[position..].find(pattern_end) { | |
let end_index = position + match_index; |
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 | |
import subprocess | |
import datetime | |
import random | |
import sys | |
import os | |
EUREKA_REPOSITORY: str = os.environ.get("EUREKA_REPO_PATH") or os.path.expanduser("~/eureka") |
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
use std::collections::HashMap; | |
#[macro_export] | |
macro_rules! map ( | |
// ----------------------------------------------------------------------- | |
// Inferred types, no bindings. | |
{$($key:expr => $value:expr;)+} => { | |
vec![ | |
$( | |
($key, $value), |
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
def zero_rand_places(n: int = 5, l: int = 4, u: int = 5) -> float: | |
''' | |
Generates a random floating point zero, with n decimal places between | |
0.1 and 0.9, with l and u clamping the lower and upper bounds of the | |
number, e.g. with l = 4, u = 5, n = 3: 0.400 <= R <= 0.599 | |
''' | |
lb: int = 0.1 * 10**n | |
ub: int = 0.1 * 10 ** (n + 1) - 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
''' | |
This is a sort of rudimentary concise language-agnostic esoteric word hashing algorithm that's easy to copy+paste | |
into existing code, not designed to obfuscate the word, and with no regards to collision prevention. | |
Condenses words down to 4 characters, pads words less than 4 characters, retains its ability to be identified | |
as a same-length string, with knowledge of the original set, and that the machine can also use, for example, | |
to compute an offset in a contiguous array, among other things. | |
''' | |
def str_abbr(input: str, limit: int = 4, pad: str = '.') -> str | None: |
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/sh | |
## Sometimes pacman enters a corrupted state where it cannot | |
## download any packages due to no public key being present | |
## to self-sign the archlinux certificates. | |
## | |
## This script fixes and reconstructs /etc/.pacman.d/gnugp | |
## Tested exclusively on Arco Linux; the results may be | |
## unpredictable on a non-Arco/Arch distro, e.g. | |
## Endeavor, Manjaro, etc.. |
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
macro_rules! typedef { | |
($name:ident, $type:ty) => { | |
#[derive(Debug, Clone)] | |
struct $name($type); | |
impl From<$type> for $name { | |
fn from(value: $type) -> Self { | |
$name(value) | |
} | |
} |
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 Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response] | |
"AutoRepeatDelay"="250" | |
"AutoRepeatRate"="6" | |
"BounceTime"="0" | |
"DelayBeforeAcceptance"="0" | |
"Flags"="59" | |
"Last BounceKey Setting"=dword:00000000 | |
"Last Valid Delay"=dword:00000000 |
NewerOlder