Skip to content

Instantly share code, notes, and snippets.

Tailoring the future...

Nenad Novaković dvlden

Tailoring the future...
View GitHub Profile
dvlden /
Created Jan 24, 2022
Disable `.DS_Store` file creation on Network & USB
# Disable `.DS_Store` file creation on Network & USB
defaults write DSDontWriteNetworkStores -bool true
defaults write DSDontWriteUSBStores -bool true
# Check the current policy
defaults read
dvlden / 1.js
Last active Apr 13, 2019
JavaScript Algorithm
View 1.js
// 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)) {
dvlden / index.js
Created Aug 5, 2018
MutationObserver in JavaScript
View index.js
* 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 / index.js
Created Apr 10, 2018
Just testing the "call, apply and bind"...
View index.js
// I never really understood them, but now I think I got it...
let anObject = {
name: 'Nenad',
age: 25
let myArguments = ['Serbia', 'Valjevo', 'in a relationship'];
let anFunction = function (country, city, relationshipStatus) {
dvlden / extract-cookies.php
Last active Aug 3, 2022
Quickly Extract "Netscape HTTP Cookie File" to "JSON" (from ".txt" to ".json" format)
View extract-cookies.php
function extractCookies ($string) {
$cookies = array();
$lines = explode("\n", $string);
// iterate over lines
foreach ($lines as $line) {
// we only care for valid cookie def lines
dvlden / dummy.js
Created Oct 14, 2017
Some JS Testing...
View dummy.js
const getSiblings = element => {
let siblings = []
let sibling = element.parentNode.firstChild
while (sibling = sibling.nextSibling) {
if (sibling.nodeType === 1 && sibling !== element) {
dvlden /
Last active Dec 16, 2022
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
dvlden / snippet.js
Last active Sep 11, 2017
ITAcademy/LinkLearning - Skip time waiting on lessons
View snippet.js
(function ($) {
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
dvlden / macOS -
Last active Sep 8, 2018
I tried to simplify all the keystrokes / shortcuts and common terminal commands that I use daily myself... I hope it helps anyone, spent too much time writing this.
View macOS -

Don’t be afraid of Terminal on any OS, let me simplify things for you! I’ve been using Terminal a lot lately, yet I remember the time when I was entirely afraid of even typing anything in it...

Whenever I needed something on my Mac, that required Terminal commands, I had a tough time figuring what does it mean, how does it work; especially when it's a very long one. Well, it was worth it, not just copy/pasting the command, seeing it works and continuing with my day.

Key Representation

dvlden / 01 - macOS Workspace
Last active Jan 28, 2022
My complete macOS Workspace Setup Tutorial!
View 01 - macOS Workspace

Setting up workspace for web development...

If you are planning to use everything from this guide, do it in exact order, otherwise install only what you need...

Try my automated macOS setup... It will configure all of these automatically for you. If you don't want everything, feel free to clone repo and modify what you want/need!

dvL-den macOS Setup