Angular $http Cache Examples

Angular’s built-in $http service and it’s $http.get() method do NOT cache responses by default. There are a few different ways you can enable $http caching, below are some helpful examples of each. These examples are ordered in terms of difficult,…

Angular.js Custom Tag Delimiter’s

Angular’s templating system is wonderful, and it build’s on some common practices established years ago by the Handlebars templating engine. Sometimes I encounter projects where an existing templating system conflicts with Angular, such as a server-side templating language like Mozilla’s…

Restrict an Angular.js Directive to a Specific HTML Tag

This is the best way I’ve found to create an Angular.js directive that’s restricted to a specific HTML element or tag. There’s no directive configuration option in Angular.js to do this, but I recommend adding the `restrict: ‘A’` to your directives config so that it only matches an attribute name. Once we have that in place the key aspect that makes this happen is this line: if ( element[ 0 ].tagName !== “A” ) { … }

How to Fix Slow Gulp Uglify Builds

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.

Preventing Possible Attempt to Enumerate Users [SOLVED]

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…

WordPress Database Migration & Transfer Tools

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…

Combining WP_Query Search & Taxonomy Parameters

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…

Self-Signed, Trusted Certificates for Node.js & Express.js

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.

JSON POST Requests: $_POST Won’t Work

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…

Built-in WordPress Taxonomy & Post Type Reference

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 —…

Angular On Enter Key Directive

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.

Pulsating Text with CSS3 Animations

The following snippet of HTML, CSS and JavaScript will provide you with a pulsating text effect that fades in and out infitately over a 3 seconds. This is nothing new or spectacular, but it was hard for me to find…