How to Validate a Phone Number in a Joomla Extension
In the article Add a Click To Call Button & SMS Chat to Your Joomla Site, I presented a ready-to-use extension, XT Twilio for Joomla to implement a simple communication channel on a website. The basic extension sends SMS messages (or supports a Click2Call workflow) between users and the sales area. In the second article of this series, How to Customize a Joomla Extension for SMS Chat, I presented a case to add the client name field to the extension and personalize the SMS messaging.
How to use Google Sheets as a Database for your PHP App
Twelve years ago, Google had, in my opinion, the ambitious idea of releasing a product that would be in direct competition with Excel. Google Sheets has since gained popularity over the years and become much more than just a spreadsheet. Being an online application, it’s a lot easier to integrate it with different online tools that you use. In this tutorial, we are going to test the flexibility of Sheets by fetching data from Order Desk’s API, updating a Google Sheet and sending a Twilio confirmation via SMS. We will use Order Desk to simulate an online store fulfillment system that backs up it's data into a Google Sheet.
For this tutorial, you will need:
- A PHP development environment
- A global installation of Composer
- A Twilio Account
- A Google Account
- An Order Desk Account
Setup our Development Environment
To start off, let’s create a ...
Getting Started with ASP.NET Core Razor Pages
Razor Pages is a new aspect of ASP.NET Core MVC introduced in ASP.NET Core 2.0. It offers a "page-based" approach for building server-side rendered apps in ASP.NET Core and can coexist with "traditional" MVC or Web API controllers. In this post I provide an introduction to Razor Pages, the basics of getting started, and how Razor Pages differs from MVC.
Razor Pages vs MVC
If you've used ASP.NET Core for building server-side rendered apps, then you'll be familiar with the traditional Model-View-Controller (MVC) pattern. Razor Pages provides an abstraction over the top of MVC, which can make it better suited to some page-based apps.
In MVC, controllers are used to group similar actions together. When a request is received, routing directs the request to a single action method. This method typically performs some processing, and returns an
IActionResult, commonly a
RedirectResult. If ...
Search Engine Optimization (SEO) is vital for most web applications. You can build SEO-friendly Angular apps with Angular Universal, but what about the performance and efficiency of such an application? This post will show you how to build fast Angular apps that use client and server resources efficiency while providing server-side rendering (SSR) for SEO purposes.
In this post we will:
- Create an Angular application
- Add server-side rendering with Angular Universal
- Set up an
HTTP_INTERCEPTORwith a TransferState service, to prevent duplicate calls to server resources
- Create a route resolver to protect against slow external APIs.
To accomplish the tasks in this post you will need to install Node.js and npm (The Node.js installation will also install npm) as well as Angular CLI. cURL for macOS, Linux, or Windows 10 (included with build 1803 and later) and Git are referred to in the instructions but are not required ...
Create an Incoming Webhook to Forward SMS to Slack with Laravel
As a business entity, you will always get SMS from customers seeking support, giving you feedback, filing complaints or even sending compliments. Because notifications can become overwhelming, it helps to consolidate all the SMS in one central place for easier reference.
In this tutorial, we will automatically forward SMS sent to a Twilio number to a slack channel using a webhook implemented in Laravel.
Set Up a New Laravel Project
If you don't have one already set up, we’ll need to install a fresh Laravel application. A guide on how to set up Laravel can be found in the official Laravel documentation.
We also need to install the Twilio SDK for PHP in our project. In your terminal, navigate to the project directory and run the following command:
$ composer require twilio/sdk
Getting started with Slack Incoming ...
How to Customize a Joomla Extension for SMS Chat
In the article Add a Click To Call Button & SMS Chat to Your Joomla Site, I presented a ready-to-use extension, XT Twilio for Joomla to implement a simple communication channel on a website. The basic extension sends SMS messages (or supports a Click2Call workflow) between users and the sales area.
In this tutorial, I’m going to introduce how to solve a practical requirement of a real-world project; the need to add a first name field (and other fields) to the Contact by SMS module.
You will need a basic website configuration:
- Local installation of Joomla (preferably version 3.8 or superior). The full detail of CMS requirements can be found here.
- PHP 5.5 or superior. PHP 7.2 is highly recommended.
- MySQL 5.1 or superior. MySQL 5.5.3 + is recommended.
- A PHP development environment (only if you plan to develop your own extension).
- Optional: NodeJS ...
Create a Single Page Application with Symfony and Vue.js
In this tutorial, I will walk you through how to set up a Symfony and Vue.js application coupled together for utilizing the Twilio API. Symfony will handle all the backend operations while Vue.js will take care of the frontend DOM rendering.
If you are building an app using the Twilio API, you will need to generate a token. At the end of this tutorial, you should be able to generate this token from our Symfony application.
This tutorial uses the following:
Generating music with Python and Neural Networks using Magenta for TensorFlow
Machine Learning is all the rage these days, and with open source frameworks like TensorFlow developers have access to a range of APIs for using machine learning in their projects. Magenta, a Python library built by the TensorFlow team, makes it easier to process music and image data in particular.
Since I started learning how to code, one of the things that has always fascinated me was the concept of computers artificially creating music. I even published a paper talking about it in an undergrad research journal my freshman year of college.
Let's walk through the basics of setting up Magenta and programmatically generating some simple melodies in MIDI file format.
First we need to install Magenta, which can be done using pip. Make sure you create a virtual environment before installing. I am using Python 3.6.5, but Magenta is compatible with both Python 2 and ...
Create SMS Business Cards with Twilio and Node.js
After I gave a talk at Shakacon this year, I was pleased that people came up to me with additional questions—pleased, that is, until someone asked me for a business card and I realized I didn’t have any with me. Whoops.
In this quick post, I’ll describe how I solved that problem by creating an app that sends business cards over SMS and I’ll show how you can do it too.
Why Build an SMS Business Card
I wanted to create something quickly that would let me share information selectively; not everyone should have my cell phone number. It had to be flexible and extensible. It had to solve the problem with the resources I had on-hand. That meant my laptop, a power adapter, and a Twilio account were my raw materials.
This app really showcases the power of Twilio and what’s possible with our ...
How to Create Search Engine-friendly Internationalized Web Apps with Angular Universal and ngx-translate
Search Engine Optimization (SEO) is important for many Angular single-page applications (SPAs). You can build SEO-friendly Angular websites with Angular Universal, but how do you make your app SEO-friendly in every language your website supports? Google, Yandex, and Baidu, might request your pages in English, Spanish, Russian, or Chinese: how do you make your server-side rendering return the correct language?
The answer is ngx-translate, the internationalization (i18n) and localization library for Angular. This module makes it easy to use translation files that provide the correct language for both client-side and server-side rendering. This post will show you how to use it.
In this post we will:
- Create an Angular application with one component, the home page
- Add server-side rendering for SEO purposes with Angular Universal
- Set up internationalization in four languages with ngx-translate
To accomplish the tasks in this post you will need to install the following: