How to name CSS classes
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
/** | |
* @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 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
/** Pre requisites | |
* MAC ONLY FOR RIGHT NOW! Not my fault. We have to wait for Headless Chrome to hit Windows users | |
1) Make an Alias to Chrome | |
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" | |
alias chrome-canary="/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary" | |
2) Make Sure yarn is installed (it caches packages so you don't have to download them again) | |
`npm i yarn` | |
3) Use yarn to install dependencies: |
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 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 = ""; |
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 | |
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 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: | |
# Sorts files created with a date and time in the file name, puts them in their respective folders | |
# This was created to sort images taken with a Samsung Galaxy phone | |
# Expected file naming convention is | |
# "year-month-day hour.minute.second.fileextension" | |
# "2017-7-5 18.23.45.jpg" | |
# | |
# | |
# requires Pillow: | |
# pip install Pillow |
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
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 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
.isDebugging .debug { | |
outline: 1px solid rgba(200, 100, 50, 0.9); | |
} | |
.isDebugging .debug * { | |
outline: 1px solid rgba(200, 100, 50, 0.9); | |
} |
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
** AttrPromise | |
* @param {element} DOM element. required | |
* @param {attributeName} String. Optional. Attribute that is expected to change. | |
* @param {rejectTime} Int. Optional. Seconds (not ms) to wait before rejecting. 0 means there is no reject time. | |
* @returns {promise} | |
*/ | |
function attrPromise(element, attributeName,rejectTime = 0) { | |
return new Promise((resolve,reject) => { | |
let hasChanged = false; |
NewerOlder