I like to write and I like to code and sometimes I write about coding.
Recently I ran into a situation where I wanted to be able to send a request to the back-end of a web application that would not be strictly possible for a user via the UI. In this post, I will explain the importance of having a good understanding of how to send different type of AJAX requests from the browser console and provide some examples for doing so.
In this post, we'll learn how to toggle between two icons using AJAX, a lovely extendable piece of code that can prove useful for a wide variety of projects and scenarios.
If you want to make sure that the data getting sent to the back-end of your react app is ready to be perfectly parsed and saved into the database then you should be using propTypes, React's built-in validation type checker.
In this post, I'm going to explain how to build a dynamic next page button that fires when clicked, requesting and displaying additional data from a back-end service via AJAX.
In this post I'm going to walk through the installation steps necessary to get React working in a Laravel project that uses Gulp.
In this post, I’ll explain how we can use the Laravel’s Builder Object to improve code reusability when creating a series of complex queries.
Recently I was tasked with the seemingly simple task of running an alter table to update the data type of a table. However, because the table had tens of millions of rows I soon discovered the task would not be so easy to solve. In this post, I'll explain the solution: creating an archive version of the table.
When building an application that develops a heavy dependency on database interaction, it's easy to start with some basic queries that eventually require refactoring due to performance reasons. In this post, I'll walk through an example query which leverages a SQL left join to improve database response time.
Recently, I was working on a Laravel website that is powered by a Wordpress CMS with a lot of static content. While developing the site, performance was never really an issue but once we started getting a lot of users the page speed got much worse. In order to solve this problem, we implemented Laravel’s caching facade. In this post, I’ll explain how to did so.
In this post, I’m going to dive into the weird and wacky world of Regular Expressions to breakdown how to replace the contents of an HTML string using PHP.
Over the course of the last year and a half, I've been implementing unit tests on an API which is responsible for sending and receiving data to a web and mobile application. Let this blog post serve as a healthy reminder of how not to write unit tests, based on the potholes I've dug for myself.
This week I attended LaraconEU 2017 along with the other members of Team Automotive from Gaspedaal.nl. It was our second year attending the conference, and we found it to be an informative look at the growing state of the Laravel ecosystem. Here are five things I took away from the event.
One of the most powerful functionalities in Laravel is the event. This feature enables all the triggers of various tangentially related functionality to occur throughout the life cycle of a model instance. Plus, events are always listening – meaning you don’t have to explicitly call them in the code to harness their powers. In this post, we’ll implement a sample Laravel model event listener.
Whenever working with data using Laravel, it can be easy to write a few small Eloquent queries within your blade files to access the database. However, this practice can quickly spiral out of control if you're not careful, increasing query load time and destroying the performance of your application. In this post, I'll explain how to extract commonly used queries to a view composer so that they can be shared across multiple views that use different blade files.
Often times when developing using Laravel, I end up stuck on an error that seems to obfuscate the real problem with my code. Luckily, there is a simple way to tail logs in Laravel that can help you get back on track!
In this post, I'm going to walk through a small code sample that automates unit testing for a sort functionality. We will call a JSON API URL, and then test that the information received is properly sorted. We'll also make the tests completely dynamic, enabling us to test multiple parameters to sort on.
Recently, I ran into the problem that my image heavy website, patagoniaonabudget.com, was loading extremely slowly. In this post, I outline the steps I took to go from a 6 second load time to under 2 seconds, specifically focusing on image rendering.
In this post, I'm going to walk through how to make a Facebook Messenger chat bot using my open source Survey Bot Repository. By the end of this tutorial, you'll have a fully functioning bot that responds to a series of questions and saves the information to a database
In this post, we're going to walk through how to scrape website data in Ruby. We'll use the Nokogiri gem to grab HTML data from Hostelworld, store that data in an array, then print hostel prices to a CSV file. This is an easily extensible block of code that you can use to pull data from around the web.
This post will cover the implementation of data from a JSON file to a Ruby on Rails application, demonstrating how to manipulate the data using controllers and views. We'll build an example app to walk through a simple use case implementing HTTParty.
This article will walk through how to create a simple application that has two databases that relate to each other using a foreign key. Unlike formal documentation, my hope here is that by demonstrating the actual uses in migrations, models, controllers, and views, it will be easier for others to implement this feature.
Many applications and websites require e-mail capture to target leads, subscribers, and customers. This is a tutorial on how to create a reusable newsletter form for e-mail and any other user information your app requires. We'll use a brand new app for the purposes of this example, but this code is extendable for most existing Rails apps as well.
The HAML syntax is like installing all the software updates on your computer: at first it seems like upgrading is going to take forever and it's not worth it, but once you're up to date the time saved pays for itself and you could never imagine going back to your old ways. You can also learn a ton from the official HAML reference, but consider this a cheatsheet to bootstrap your proficiency and get started with some of the major use cases.
Elasticsearch is an open-source, RESTful search engine built in Java, but it's possible to use it in Rails as well. Here, I'll walk through getting started with downloading and using it in a simple Rails application, utilizing the Searchkick gem.
In this post I'm going to walk through a skeleton app with basic functionality to create nested forms, which enable the creation of new objects in multiple models at the same time. For the example application, we'll create a workout tracker with a form that can create workouts and the specific exercises within that workout.
Reddit. Quora. ProductHunt. What do all of these websites have in common? Besides their rabid fan bases, they enable a community to interact with content via simple voting buttons that users can click on to promote or demote content. Luckily for Ruby developers, there's an awesome gem I came across this week that quickly builds the same functionality. Here's a tutorial on how to get started with acts_as_votable.
After one of my friends showed me the updated Fitbit app and I did some research on their newly announced products which will begin to collect Heart Rate and GPS location data, I decided to dig into their API the following day and figure how to connect it to a rails application.
Ruby's enumerable module consists of a number of helpful methods to write tight code when manipulating collections of data like arrays and hashes. Although the formal documentation contains a great overview of all the methods, it can be daunting to sift through which ones are actually useful and how to implement them. Let's explore some of the best right here!
Over the course of the last few weeks, I’ve been diving into the wide world of algorithms. Although they can be intimidating at first, constructing algorithms is just the coding version of solving a puzzle, which activates the creative problem-solving capacity of your brain and can actually become quite fun.
To practice and learn more about what’s going on behind the scenes with authentication, let’s build a simple chat room that will enable members of a patient’s care team to send and view messages containing sensitive data. Ready to get started?
Let’s explore how to get sample data from an Excel CSV to render as a table on a skeleton rails application. We’ll use activity tracker data to build a steps leaderboard for a fitness challenge.
This week, I'm going to walk through the steps to start automating a Twitter account to perform a variety of useful functions using the Twitter API. You can also view these instructions in the readme file of my Github Repository. If you're not interested in the code, you can just skip to the bottom to see what the bot does.
We spent the entirety of last week split into three groups: two built food ordering web applications and the third built an API named "Expenserizer" that would handle the financial data from the other two teams. Here's a breakdown of how my team decided to approach the task at hand:
Check out My Projects for more
Writing is a way of putting my curiosity on steroids while traveling. This is what I see and how it feels, raw and unfiltered:
After spending three months in the wonderful landscapes of Patagonia spending a paltry average of $30 a day, I decided to write a book about how I made this a reality, in hopes that I would open up such an adventure to other like-minded travelers. Patagonia On A Budget is available to purchase on Amazon.
Traveling in Patagonia doesn't have to be as expensive as packaged tour operators, TripAdvisor and Lonely Planet might make you believe. With Patagonia On A Budget, you'll learn:
The best value on the craziest adventures
Prices and details for accommodation, transportation and activities in every destination
Detailed maps and itineraries of the most popular backpacking routes
Recommended campgrounds with the best rates and facilities
Instructions and safety advice for hitchhiking
The electronics, websites, and applications to depend on during your expedition
Special instructions for surviving and thriving during long hikes through national parks.
Learn more at PatagoniaOnABudget.com