Latest Blog Posts
Visual Studio Code Xdebug Launch.json File Configuration
This is the launch.json debugging configuration I use when debugging PHP code using Xdebug in Visual Studio Code. All you need to do is replace [absolute path] with the absolute path of your server’s project root directory. For example, when using Laravel Homestead your absolute path would look something like /home/vagrant/sites/project-root.
How to reuse Trix WYSIWYG editor with Vue.js
The problem I fell in love with the Trix WYSISYG editor while using it in Basecamp. I’ve used many editors over the years, but they’ve all come with their own type of headache. While getting Trix up and running is fairly simple, I did run into a problem when trying to reuse the editor inside…
How to fix Jetpack Site Accelerator not serving background images over CDN
What is Jetpack Site Accelerator and why should I use it? With over 5 million installations, Site Accelerator, formerly Photon, is easily one of the most used and useful plugins available for WordPress. If you’re serious about user experience or SEO, this plugin is a must have in order to compress and speed up displaying…
Step-by-Step Git Conflict Solving Workflow
It’s inevitable that once you starting using Git you’ll run into merge conflicts; especially, when working with a team of developers. Use this step-by-step Git conflict solving workflow if you’re confused by how to actually solve Git conflicts using the command line. There are tons of GUI tools to accomplish this, but it’s always great…
Fixing Ionic iOS build fails with ‘edit-config’ tag in config.xml
Since iOS 10, it’s mandatory to provide a usage description in the info.plist when trying to access privacy-sensitive data such as the user’s contact list or camera. According to majority of the documentation for the plugins, you need to add a edit-config tag to the config.xml file for each permission. <edit-config target=”NSCameraUsageDescription” file=”*-Info.plist” mode=”merge”> <string>need…
419 (Internal Server Error) Response from AJAX requests running Laravel on Google Cloud Platform
After using Firebase applications for app development over the last few months, I decided to move some of my other web apps to Google Cloud Platform. While it’s definitely a bit overwhelming at first, the speed, autoscaling, and deployment have really made it nice to work with. However, I quickly ran into multiple hurdles when…
Quick and easy fix to handle the “Missing or insufficient permissions” Firestore error in Angular or Ionic with ReactiveX
First and foremost, this error message doesn’t help us at all in figuring out what the issue is. This usually happens when you’ve subscribed to an observer and then lost the permissions needed to access the content (e.g. logging out of an application) before unsubscribing. I ran into this problem when working on an Ionic…
Setting Up Xdebug on Laravel Homestead With PHP 7
At the time of writing this, the latest version of Laravel Homestead (4.0) comes packaged with PHP 7 and Xdebug 2.4.0RC3. However, it’s not configured for remote debugging. Follow the steps below to properly setup Xdebug. First, ssh into the vagrant box and append the content below to the /etc/php/mods-available/xdebug.ini file. xdebug.idekey = “phpstorm” xdebug.remote_enable = on xdebug.remote_connect_back = on…
Git: Undo all working tree changes, including untracked files and directories
Use the following commands if you’d like to remove all recent changes made since the last commit. This command resets the index and working tree. Any changes made to tracked files in the working tree since the last commit are discarded. git reset –hard This will recursively remove all files and directories that are not…
WordPress Infinite 301 Redirect Loop
Depending on your current environment setup, there’s a chance you’ll come across an infinite 301 redirect loop when installing WordPress. If you do, there’s a simple temporary solution to fix the problem. Place this line of code in your theme’s functions.php file. remove_filter( ‘template_redirect’, ‘redirect_canonical’ ); This will prevent the redirection for feeds, trackbacks, searches, comment…
Bulletproof® Upgraded™ MCT Oil
MCT (Medium-Chain Triglycerides) oil is extracted from palm and coconut oil. It has barely any flavor, so it can be added to your coffee, protein shake, or pretty much anything else you can think of. MCT oil has a ton of health benefits including short-term memory gain, enhanced focus, increased energy, and nutrient absorption, among…
Fight developer burnouts and depression
Cognitive function refers to things like memory, the ability to learn new information, speech, and reading comprehension. Infants and young children are typically able to learn and retain things more easily than adults. As we get older, our cognitive function starts to decrease; however, studies suggest that brain exercises like mathematical problems enhance our cognitive…
Reduce fail2ban memory usage
The initial fail2ban virtual memory overhead on my MediaTemple DV Developer server was approximately 350MB. While that is a lot, you’re not stuck with it. You can modify the over-sized default stack size by adding one line of code to the configuration file. To limit the memory used by fail2ban, edit /etc/default/fail2ban and add this…
My road to optimal performance
Development isn’t just a job, it’s a lifestyle. And if you’re like me, it’s an obsession. Unless you consider this a “job”, you’re overly passionate about this field. You sacrifice sleep, food, and probably even sex when you’re zoned in to your work. Unfortunately, this obsession takes a toll on your mind and body. Before…
Gotcha! Use Static Class Members in WordPress 3.0+ Themes
I recently came across an issue when I was writing a custom class to handle functionality in a WordPress theme that was instantiated in the functions.php file. Normally, this doesn’t present an issue; however, you’ll receive a Fatal error when trying to access methods of the object in a template that was loaded through the get_template_part()…
Save Time Converting SVGs to Raphael.JS
I’ve been working on a really sweet side project relating to… Well, you’ll just have to wait and see. 🙂 What I can tell you is that I had an image set that I wanted to let users interact with and was extremely eager to test out SVG interaction in the browser! I tested a…
The BEST Book to Learn Ruby on Rails?
Whether you’re an experienced programmer or a noob in the field, learning a new language can be a difficult task if you don’t have a good source to learn from. When I started my dive into PHP 8 years ago I read through countless books and sites trying to get a solid understanding of the…
Using a MAMP Database with Ruby on Rails
One of the first hurdles that I came across after making the move to Ruby (and Rails) from PHP was utilizing some of my previously created MySQL databases in MAMP. I have always been a fan of MAMP as a PHP developer because it was extremely easy to setup a project and get coding. It…
StageWebView Videos
Create StageWebView instance and load video: var webView:StageWebView = new StageWebView(); var path:String = ‘file://path_to_video/video.mp4’; webView.stage = this.stage; webView.viewPort = new Rectangle( x, y, width, height); webView.loadURL(path); Dispose and remove: webView.reload(); webView.viewPort = null; webView.dispose(); webView = null;
Playing .mp4 Videos in the Native iOS Video Player with StageWebView
I’ve been working on an iPad app using the AIR 3.0 SDK alongside the Flash iOS compiler and ran into a speed bump today trying to find a solid, fully working solution to accomplish this task. My goal was to have a video launch inside the native iOS video player allowing the user to use…
Simulate click on browse button like Flash using jQuery
In this article I’m going to show you how to create a flash style browse button without the ugly input field similar to the flash one WordPress uses for their upload forms. First thing we need to do is create the button element that when clicked will launch the file selection window. Select Files Next…