Skip to content

Instantly share code, notes, and snippets.

View dvlden's full-sized avatar
🧨
I am the error that you should catch!

Nenad Novaković dvlden

🧨
I am the error that you should catch!
View GitHub Profile
@dvlden
dvlden / index.js
Created August 5, 2018 16:14
MutationObserver in JavaScript
/**
* Sometimes, an element that you might need to retrieve
* is not visible right away. It might be added later on
* via an asynchronous action.
*
* This is where MutationObserver in JS comes in
* and here you can learn from example.
*
* Example will retrieve video element from the web page.
*/
@dvlden
dvlden / 1.js
Last active April 13, 2019 22:03
JavaScript Algorithm
// Find missing numbers in the array
const numbers = [1, 2, 7, 3, 5, 4, 9]
let missing = []
for (var i = 1; i <= Math.max(...numbers); i++) {
if (!numbers.includes(i)) {
missing.push(i)
}
}
@dvlden
dvlden / No_DS_Files.sh
Created January 24, 2022 19:30
Disable `.DS_Store` file creation on Network & USB
# Disable `.DS_Store` file creation on Network & USB
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Check the current policy
defaults read com.apple.desktopservices