Code Support
Professional Web Development
Category: Code
Array.sort
refactored es6 style: I would avoid Wes Bos minimized solution below as it doesn’t return 0 on duplicates which result in unstable sorting when having duplicates in the array.
February 16, 2017
JavaScript
Arrow Function example
In this example we have a array of car objects and the goal is to take all the ford cards and add their km together
February 15, 2017
JavaScript
Optimized multiple eventlistener for change events
Add 1 event listener for the container but target the input nodes:
February 15, 2017
JavaScript
Immediately Invoked Function Expressions – “IFFY”
This is a IFFY Douglas Crockford style: More common seen in the wild: Note: If you are using this to keep variables in a scope you might consider if you want to use ‘let’ and ‘const’ instead if you are writing es6 code! Read more about that in our aticle about var, let and const …
February 15, 2017
JavaScript
Configure a production ready WordPress Installation on your Digital Ocean VPS
1. Create a WordPress droplet on Digital Ocean, at the time of this writing I am creating WordPress 4.7 on Ubuntu 16.04 2. Configure your domain to it points towards your newly created WordPress droplet 3. SSH into the the droplet and do the following: SSL: hit enter and then paste this at the bottom …
January 25, 2017
Apache, Articles, Code, Ubuntu/Debian, WordPress
Install Let’s Encrypt on Apache
hit enter and then paste this at the bottom of the config , save and exit. add this to the .htaccess for redirects
January 22, 2017
Apache, Ubuntu/Debian, Unix
Copy local environment mkdir roots
If you get a issue with deploy regarding it not being able to copy local path etc. Inside group_vars / ENVIRONMENT / wordpress_sites.yml For repo: Instead of choosing the main trellis git project as instructed choose the bedrock .git project and then make sure that repo_subtree_path is commented out.
September 20, 2016
WordPress