I use gulp-uglify to minify my JavaScript for a large Angular.js project. Recently the compile process became incredibly slow, taking upwards of 15 seconds to compile JavaScript each. I’m convinced there is an underlying issue here, but for now I was able to solve the issue using a filesystem cache. This reduced a the JS build task with Uglify from 15-20 secs down to 500ms-1.5secs.
What is User Enumeration? WordPress websites may reveal whether a username exists on system through the author query variable. When a web app leaks information about whether a username exists or doesn’t exist, this is called user enumeration. A common example is when you see a validation notice telling you that the username is already…
As of 2017 here are the two best ways I’ve found to handle the transfer of a WordPress database from development to production. WP Migrate DB Pro The WP Migrate DB Pro WordPress plugin will let you push, pull, and sync database tables between WordPress installations. This is substantially better than a basic find/replace for…
WP_Query is the primary way to write custom queries in WordPress. If you’re having trouble combining a search value (s argument) and taxonomy query (tax_query argument) using WP_Query try using the following class to solve the issue. /** * Search Within a Taxonomy * * Support search with tax_query args * * $query = new…
If you want to fully replicate an https/SSL Node.js/Express app server locally you’ll need a self-signed AND trusted certificate setup. More often than not I see dev’s settle with an untrusted state for their localhost, which is an annoying and frustrating work around. I don’t want to tell Chrome and Safari that I trust the website every single time I open it up. Luckily there’s a way around this, just follow the steps below on your mac to get `https://localhost` serving your Express.js Node app loading with SSL locally.
Receiving JSON POST data in PHP is a common scenario I come across when building custom WordPress API’s. If you’re working with JSON API’s powered by PHP you may find that $_POST is not working with JSON, and you may be seeing a broken response of Array or NULL. Processing $_POST data with application/javascript headers…
Track client-side JavaScript errors as Google Analytics events using Google Tag Manager and avoid error logging software.
Below is a list of WordPress built in taxonomy names and built-in post type names. Never name your custom taxonomies and post types with one these to avoid collisions. Taxonomies category — Categories (Posts) post_tag — Tags (Posts) nav_menu — Menu items (Appearance > Menus) post_format — Post formats Post Types post — Posts page…
This should have been easier to solve then it was, so I thought I’d post it here for anyone else looking for a way to reset a geolocation prompt in Google Chrome.
I’ve been doing a lot work with Angular.js lately, and I continue to find directives more and more useful. Here’s a common directive I frequently use to trigger a scope method when the `ENTER` key is pressed.
A free, open-source way to record your screen as an animated GIF.
The lodash library’s isEqual() method provides a deep comparison between two JavaScript objects: var user1 = { name : “nerd”, org: “dev” }; var user2 = { name : “nerd”, org: “dev” }; ( user1 == user2 ) // returns false – NO WORKY _.isEqual( user1, user2 ); // return true – WORKS I’ve found…
I’ve been working with the Site Origin Page Builder plugin a lot lately, which is wonderful and I highly recommend it for WordPress CMS development. I found myself in need of a basic SiteOrigin Page Builder conditional function to check whether the current post or page content was created with the default WordPress editor or…
Last night (February 13, 2015) I presented at the Boston Node.js Meetup hosted by LogMeIn. I shared an approach I’ve used working to build a static site engine using Node.js for MIT Technology Review. It was a fun experience, I hope to do it again in the future. Resources Slide deck Gist snippets Project repo…