Thursday, November 21

Author: phpInfo

Web Tricks

The Complete Anatomy Of The Gutenberg WordPress Editor

It seems that Gutenberg has been a term of controversy in the world of WordPress lately. Hailed as the most significant change to WordPress 5.0 this year, the Gutenberg editor has received a mixed response from web developers and regular folk alike. All of this chaos is making it difficult to see Gutenberg for what it really is. So, I’ll try to put some of the confusion to rest once and for all.In this article, I will cover the following: What is Gutenberg? More Than Just An Editor What Does Gutenberg Change In WordPress? Installing Gutenberg Exploring Gutenberg At Length Pros And Cons Understanding Compatibility Issues Gutenberg Is The Future Latest News And Further Resources 1. What Is Gutenberg? Named after Johannes Gutenberg, who invented the mechanica...
Web Tricks

Everything You Need To Know About Alignment In Flexbox

History Of Flexbox Alignment For the entire history of CSS Layout, being able to properly align things on both axes seemed like it might truly be the hardest problem in web design. So the ability to properly align items and groups of items was for many of us the most exciting thing about Flexbox when it first started to show up in browsers. Alignment became as simple as two lines of CSS: See the Pen Smashing Flexbox Series 2: center an item by Rachel Andrew (@rachelandrew) on CodePen. The alignment properties that you might think of as the flexbox alignment properties are now fully defined in the Box Alignment Specification. This specification details how alignment works across the various layout contexts. This means that we can use the same alignment properties in CSS Grid as we use ...
Web Tricks

Debugging Go Code with Visual Studio Code

I recently wrote about My Top VSCode Tips and Tricks and among them was Debugging. In this article, I'll cover how to debug your Go code, so it goes without saying that a prerequisite for this article is that you understand the basics of writing Go. If you do not have experience writing Go, and would like to learn, here's a really short short list of the best resource to start your Go journey. A Tour of Go Setup You need have the following requirements met. You know a little about Go to write a simple program, or even a small http server. You have go installed in your machine and the environment variable $GOPATH is set. (It defaults to ~/go) The path $GOPATH/bin is exposed to your PATH. You have Visual Studio Code installed. You should have the VSCode-Go plugin installed. Once you have thi...
Web Tricks

A Simple Tip to Improve Your Productivity With Monday.com

I believe we can all agree that time is an asset that we do not have. One minute you are 19 and playing video games, hanging out with friends, the next minute you are 45 and driving kids to school. It’s true we do not have enough time on our hands, doesn’t mean we can’t utilize the little time we have. One of the best skills to have in this world is time management. Proper time management leads to increased productivity, increased productivity can lead to things like more money, time relax or just have fun. There are many tools that help you manage your time: we have Trello, Basecamp, Asana and many others. Today, we’ll be talking about Monday.com. Monday is neither “Trello clone” nor a spreadsheet. In a world where many tools have come up to solve the time management needs of creatives n...
Web Tricks

Handling Authentication In Vue Using Vuex

Traditionally, many people use local storage to manage tokens generated through client-side authentication. A big concern is always a better way to manage authorization tokens to allow us to store even more information on users. This is where Vuex comes in. Vuex manages states for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion. Sounds like a better alternative to always checking localStorage? Let’s explore it. Prerequisites Knowledge of JavaScript Node installed on your local system Knowledge of Vue Have Vue CLI installed Have read Vue Authentication And Route Handling Using Vue-router ― Scotch Setting up the application modules For this project, we want to creat...
Web Tricks

6 Awesome Ways to Take A Screenshot of your Code

Introduction At some point behind that screen, you’ll need to capture an image of code - whether it’s yours or someone else's. This could be for different reasons; reference for an article, asking for help from a forum, showing off on Twitter, or even storing valuable tidbits that you’d like to go through later. Either way, the importance of screenshot tools cannot be overemphasized right now because like it or not, we could all use one. After some digging, here are six awesome ways to take screenshots of your code. Let’s look in! Polacode Polacode is a Visual Studio Code extension that lets you create unique and sharable screenshots of your code. While using Polacode, it retains your existing theme and fonts and renders them for an awesome layout. Check this out: In the screenshot abo...
Web Tricks

​Build a Chat Widget with Python and JavaScript

Building quality digital products is a requirement toward acquiring long-term customers, but inefficient communication is an efficient way to lose them just as quickly as you gain them. The internet is currently the world’s largest marketplace and everyone is building something for an online audience to consume, however, it would be a shame if there isn’t a way to receive feedback or interact with customers in realtime. In this tutorial, we will look at how we can create a realtime chat widget using Pusher, Python, and JavaScript. When we are done building, the final application will look and work like this: In the image above, we can see a digital product called “SPIN” and it has a chat widget option for visiting customers to interact with. On the left browser window, a customer visits t...
Web Tricks

Docker and Visual Studio Code

I recently wrote about My Top VSCode Tips and Features, and one of the VSCode plugins mentioned was the Docker Plugin. Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud. Quite a mouthful, but wikipedia explains it a bit clearly. Docker is a computer program that performs operating-system-level virtualization also known as containerization. Essentially, it enables us package our applications into images, and run them as containers on any platform that has docker installed. The aim for this article is to showcase the various ways the Visual Studio Code Docker plugin makes life easier when working with Docker. We'll look at 2 developer stacks, NodeJS and Golang. Installation You need...
Web Tricks

JavaScript String Manipulation (Solution to Code Challenge #12)

Last time on the code challenge #12 we looked at problems involving the use of String Manipulation techniques. Yet to try your hands at the challenge? You can check it out here. You can also see other fantastic submissions in the Spectrum Chat. In this post, we shall be solving these awesome challenges and you know the best part? Chris did really cool videos to better explain these challenge solutions! The Challenge Manipulating strings form the basis of programming in JavaScript and is important both in simple logical instances to even more complex instances. In this challenge solution, we employed the use of functions in JavaScript as well as array and string methods. The Base Pen A base pen was provided for you to easily get started with the project. The pen consists of JavaScript code...
Web Tricks

Create a Typing Speed Effect with VueJS – Part 2: Timer and Score Board

Introduction In Part 1 - Create a Typing Speed Effect with VueJS We saw how to create a Typing Speed Effect. We are going to extend what we built previously, and include a timer and a score board, so that users can type and see the times they typed in faster. In order to follow along, you must have read through part 1. Logic Since we already have the typing effect covered, we need to do the following. There should be a 60 second timer that will count down whenever a user is typing. When the time reaches 0 (Zero), the typing area should be blured, and the typing speed calculated. The metrics for calculating the typing speed for a user is Number of correct words typed in a minute + typos. We will also give the user the number of typos they made as a single number. We will then list the leadi...
Web Tricks

Introducing Laravel Nova

Laracon is here again. For those of you that don't know, Laracon is the event where that happens every 6 months where we get a look at the latest and greatest in Laravel. We'll write an article on the latest features in Laravel once we've compiled them. But, for now, let's talk about Nova. Laravel's Nova is a beautifully designed administration panel designed by the team behind Laravel. Nova is a single-page application built on the Vue.js ecosystem and Tailwind. Not only does it look cool, it's also highly customizable in a true Laravel fashion. Nova is not yet out for public consumption, and it's a paid product, but if a highly customizable dashboard is what you need, you can signup and get alerted when it goes live next month. Calling it an admin dashboard doesn't do it justice. I de...
PHP, Web Tricks

WordPress Notifications Made Easy

WordPress doesn’t offer any kind of notification system. All you can use is the wp_mail() function, but all of the settings have to be hardcoded, or else you have to create a separate settings screen to allow the user tweak the options. It takes many hours to write a system that is reliable, configurable and easy to use. But not anymore. I’ll show you how to create your own notification system within minutes with the free Notification plugin. By notification, I mean any kind of notification. Most of the time, it will be email, but with the plugin we’ll be using, you can also send webhooks and other kinds of notifications. While creating a project for one of my clients, I encountered this problem I’ve described. The requirement was to have multiple custom email alerts with configurable c...
Web Tricks

My Top 8 Visual Studio Code Tips and Features

Visual Studio Code has become one of the most used and loved Text Editors in recent years. Here are some statistics from the 2018 Stackoverflow Survey:- Most Popular Development Environments. Source: https://insights.stackoverflow.com/survey/2018/ 1. Visual Studio Code CLI Visual Studio Code comes with an inbuilt Command Line Interface. Once you've installed Visual Studio Code, and have it open, press ⇧⌘P to open the command palette for Mac, or just ⌘P and the press > button. Next, type in shell command, select Install Code Command in PATH, and press enter. Now if you type in code, Visual Studio Code will open, and code <path>, Visual Studio Code will open with the directory represented by Path. To see the command line interface however, type in code -h. code -h Visual Studio Co...
Web Tricks

Managing User Permissions in Vue using CASL

There is one thing we can all agree on, no matter what language or platform we prefer for building applications — there has to be some form of control and access levels in our applications to ensure it runs smoothly. This is why the concept of user permission will quickly become commonplace for you once you build your first application. In server-side languages, user permissions can be done with little or no fuss. You can use sessions to hold a user’s information and there would be over a hundred libraries begging for the opportunity to help you manage what the user sees and when the user sees it. You can manage complex permission logic with the aid of a robust database. For JavaScript, this becomes a little tricky, given that all you may have to achieve this localStorage. In this tutorial...
Apps, Web Tricks

How To Improve Test Coverage For Your Android App Using Mockito And Espresso

In app development, a variety of use cases and interactions come up as one iterates the code. The app might need to fetch data from a server, interact with the device’s sensors, access local storage or render complex user interfaces. The important thing to consider while writing tests is the units of responsibility that emerge as you design the new feature. The unit test should cover all possible interactions with the unit, including standard interactions and exceptional scenarios. In this article, we will cover the fundamentals of testing and frameworks such as Mockito and Espresso, which developers can use to write unit tests. I will also briefly discuss how to write testable code. I’ll also explain how to get started with local and instrumented tests in Android. Fundamentals Of T...