This file contains hidden or 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
<dl> | |
<dt><code>attributes</code></dt> | |
<dd>{{dd(attributes)}}</dd> | |
<dt><code>label_hidden</code></dt> | |
<dd>{{dd(label_hidden)}}</dd> | |
<dt><code>title_attributes</code></dt> | |
<dd>{{dd(title_attributes)}}</dd> | |
<dt><code>label</code></dt> | |
<dd>{{dd(label)}}</dd> |
This file contains hidden or 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
const wordSeparatorsRegex = /—\.,;:!?‽¡¿⸘()\\[\\]{}<>«»…‘“”"\s/g; | |
/* | |
fuck | s|er|ed|ing, motherfucker | |
shit + s|ton|ing|ting, bullshit | |
dick + s|head|hole|ed | |
ass + hole|hat|face | |
cock +s | |
*/ | |
const profanityRegex = /((\b)?(fuck)(\w+)?)|((\b)?shit(\w+)?)|((\b)dick(\w+|\b))|((\b)ass(\w+|\b))|((\b)cocks?\b)|((\b)cunts?\b)|((\b)twats?\b)|(wtf)|(stfu)/gi; |
This file contains hidden or 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
<?php | |
function getUserIP() { | |
if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) { | |
if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) { | |
$addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']); | |
return trim($addr[0]); | |
} else { | |
return $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} |
This file contains hidden or 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
const profanityRegex = /(((\b|\w+)?(fuck|shit|dick|twat|cock|douche|bitch|piss)(\w+|\b))|((\w+|\b)ass?(\b|hole|face|clown))|((\b)cunt(\w+|\b)))/ |
This file contains hidden or 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
/** | |
* @description calculates the levenshtein distance between words | |
* @param {string} str a string | |
* @param {string} str2 another string | |
* @returns {object} with properties 'steps' and 'transitions' | |
*/ | |
function levenshtein(str, str2) { | |
if (typeof str !== 'string' || typeof str2 !== 'string') return; | |
let [shorter, longer] = [str, str2].sort((a, b) => a.length - b.length); |
This file contains hidden or 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 | |
echo "hello" $USER "we're gonna find some infected files"; | |
echo "=====First: let's find .oti Injections====="; | |
grep --include=\*.php -Hnrwo -P '^(@include)+.+(\.ot(i|\\x69|c)\"\);)' . ; | |
find . -type f -name "*.oti"; | |
echo "=====Next: let's find PHP files with obfuscated code being evaluated====="; | |
echo " looking for the cookie/post files"; | |
grep --include=\*.php -Hwnro -P '(\$_COOKIE(,|;))+.+(\$_POST)' . ; | |
echo " looking for the die() files" | |
grep --include=\*.php -Hwnro -P "(die+)(?:.[^'\"\$\s_a-z0-1]+)(\);)" . ; |
This file contains hidden or 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
const masculinePronouns = new RegExp('\b(she|(her(s(elf|\b)|\b))|s(on|a|u(a|\b))|el{1,2}(a|e)(-même|\b))\b((\W(m(i|e)sma)|\b))', 'gi'); | |
const femininePronouns = new RegExp('\b(she|(her(s(elf|\b)|\b))|s(on|a|u(a|\b))|el{1,2}(a|e)(-même|\b))\b((\W(m(i|e)sma)|\b))','gi'); | |
/* | |
English: she, her, hers, herself | |
French: elle, elle-même, son, sa | |
Spanish: ella, su, ella misma | |
Portuguese: ela, sua, ela mesma | |
This file contains hidden or 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 TableOfContents { | |
static listContainerClass = 'articleTOC__list'; | |
static listItemClass = 'articleTOC__item'; | |
static listLinkClass = 'articleTOC__link'; | |
static modifierSeparator = '--'; | |
/* | |
* @description Gets a list of all title elements having an ID in a given container | |
* @param {HTMLElement} container - An element containing title elements (h1, h2, h3) |
This file contains hidden or 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 Locker | |
* @description who doesn't like Konami? | |
* @example const locker = new Locker(); locker.initialize(); | |
* | |
*/ | |
// I'm not going to use Babel for a tiny static site | |
// eslint-disable-next-line no-unused-vars | |
class Locker { | |
/** |
This file contains hidden or 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 ClientStorage { | |
/** | |
* Converts a string into a namespaced string | |
* @param {string} namespace the namespace | |
* @param {string} keyname keyname | |
* @returns {string} a string with namespace.keyname | |
*/ | |
static getNamespacedKeyName(namespace, keyname) { | |
let namespacedKeyName = ""; |
NewerOlder