Skip to content

Instantly share code, notes, and snippets.

View cyberbarbie's full-sized avatar
🏠
Working from home

Tae'lur Alexis cyberbarbie

🏠
Working from home
View GitHub Profile
@cyberbarbie
cyberbarbie / mutuals.js
Last active September 2, 2021 06:07
Find occurrences in 2 arrays & return an array of unique values
// Find & return common occurences in 2 arrays & return the unique values in a new array; if there are no common occurences between the 2 arrays, provide a response
let arr1 = ["Leila", "Fry", "Leila", "Bender"]
let arr2 = ["Leila", "Bender", "Fry", "Bailey"]
let commonFriends = []
// Iterate through 2 arrays & adds common values to empty list
findTheMutuals = (arr1, arr2) => {
for (let arr1Index = 0; arr1Index < arr1.length; arr1Index++){
@joakin
joakin / git-find-me-the-fucking-deleted-file.sh
Last active July 22, 2024 06:50
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file