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
/** | |
* Recursive function that compares two deeply nested objects to determine if they are identical in their structure and values. | |
* | |
* @param {*} obj1 | |
* @param {*} obj2 | |
* @returns {boolean} Whether or not the two arguments being compared are deeply equal | |
*/ | |
function deepEqual(obj1, obj2) { | |
if (typeof obj1 !== typeof obj2) { | |
return false; |
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 OPEN_PARENS = "("; | |
const CLOSED_PARENS = ")"; | |
const ADD = "+"; | |
const SUBTRACT = "-"; | |
const MULTIPLY = "*"; | |
const DIVIDE = "/"; | |
const MODULUS = "%"; | |
const TO_POWER_STAR = "**"; | |
const TO_POWER_CARET = "^"; | |
const LEFT = "left"; |
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
lsof -t -i tcp:8000 | xargs kill |
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 | |
# | |
# Utility that reads (-r) files that match a filestring pattern and writes (-w) new files | |
# using replace string (-s) to ammend the filename using the pax archive utility | |
# Will not overwrite existing files (-k) and will update access times (-t) | |
# | |
# EXAMPLE: pax -rwtks '/IAmPatrickDVD/WrittenInStoneDVD/' *IAmPatrickDVD* . | |
# | |
pax -rwtks '/<Find>/<Replace>/' <pattern> <location> |
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 | |
find . \( -iname "*.js*" -or -iname "*.ts*" \) \ | |
-and \( ! -path "*/__mocks__/*" ! -name "*.test.*" ! -name "*.spec.*" \) \ | |
-exec sh -c \ | |
'b=$(basename $1);f=${b%.*};d=$(dirname $1);e=${b##*.}; mkdir -p $d/__tests__ && > $d/__tests__/$f.test.$e' \ | |
sh {} \; |