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
search(elements: HTMLElement[], value: string) { | |
value = value.toLowerCase(); | |
for (const el of elements) { | |
el | |
.querySelectorAll('mark') | |
.forEach((highlight) => { | |
highlight.outerHTML = highlight.textContent || ''; | |
}); | |
// make text nodes homogeneous again on firefox |
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 axum::{ | |
http::StatusCode, | |
response::{IntoResponse, Response}, | |
}; | |
use std::{fmt, panic::Location}; | |
// Make our own error that wraps all errors | |
pub struct AppError { | |
inner: Box<dyn std::error::Error>, | |
location: &'static Location<'static>, |
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
/** | |
* Trims https://invisible-characters.com/ | |
*/ | |
function trimAllWhitespace(string $str): string | |
{ | |
return trim($str, "\u{0000}..\u{002D}\u{007F}..\u{00A0}\u{00AD}\u{034F}\u{061C}\u{115F}\u{1160}\u{17B4}\u{17B5}\u{180E}\u{2000}..\u{200F}\u{202F}\u{205F}..\u{2064}\u{206A}..\u{206F}\u{3000}\u{2800}\u{3164}\u{FEFF}\u{FFA0}\u{1D159}\u{1D173}..\u{1D17A}\u{E0000}..\u{E007F}"); | |
} |
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
shopt -s extglob | |
shopt -s nullglob | |
for i in *.[0-9]; do | |
rm $i | |
done | |
# create a hashed directory for ssl use | |
for i in *.@(cer|crt|pem); do | |
hash=`openssl x509 -hash -noout -in $i` |