Saturday, April 20
HTTP/2: Background, Performance Benefits and Implementations
PHP

HTTP/2: Background, Performance Benefits and Implementations

On top of the infrastructure of the internet --- or the physical network layers --- sits the Internet Protocol, as part of the TCP/IP, or transport layer. It's the fabric underlying all or most of our internet communications. A higher level protocol layer that we use on top of this is the application layer. On this level, various applications use different protocols to connect and transfer information. We have SMTP, POP3, and IMAP for sending and receiving emails, IRC and XMPP for chatting, SSH for remote sever access, and so on. The best-known protocol among these, which has become synonymous with the use of the internet, is HTTP (hypertext transfer protocol). This is what we use to access websites every day. It was devised by Tim Berners-Lee at CERN as early as 1989. The specification fo...
Web Tricks

8 Emmet Tips You Might Not Know

Emmet (who remembers when it was called Zen Coding?) is a very useful code editor tool that brings snippets and supercharged shortcuts for generating HTML/markup and even CSS. Save tons of time in your daily workflow by learning more of Emmet syntax. Also remember that all of these examples will be in plain HTML files, but you can also configure Emmet to be used with React/JSX, Angular templates, Vue templates, and more. To give you a quick example of Emmet's main use, expanding an abbreviation into full HTML. We'll be typing the following and pressing tab to expand it: section.hero.is-info>.hero-body>.container>h1.title{Hello!} The following will be expanded to: <section class="hero is-info"> <div class="hero-body"> <div class="container"> <h1 ...
Web Tricks

Writing Snapshot Tests For React Components With Jest

In this tutorial, we will be looking at what snapshot tests are and how we can use snapshot testing to ensure our User Interface does not change without the team knowing about it. To get started, you will need to familiarize yourself with the following NodeJS - A JavaScript runtime built on Chrome's V8 JavaScript engine. React - A JavaScript library for building delightful UI by Facebook Jest - A JavaScript testing framework by Facebook. What Is Snapshot Testing? Unlike strict Test Driven Development where the standard practice is to write failing tests first then write the code to make the tests pass, Snapshot testing takes a different approach. To write a snapshot test, you first get your code working, say, a React component, then generate a snapshot of it's expected output given certai...
Creating a VS Code Theme
CSS Tricks

Creating a VS Code Theme

Everyone has special and perhaps, particular, tastes when it comes to their code editor. There are literally thousands of themes out there, and for good reason: a thing of beauty and enhancement to productivity for one can be a hindrance to another. It’s been an item on my bucket list to create my own theme. I was coding very late the one night, well into the small hours of the morning. Everyone in my house was sleeping and so, as usual, the only light was the glow of my screen. I know it’s not necessarily healthy to code like this, but it’s literally the time I’m most productive: there are minimal distractions, I’m not dealing with work stuff, family stuff, friend stuff, or puppy stuff. I can focus. I had some preferences set for the theme I had been using and, though they all worked well...
Ogilvy Changes Face After 70 Years
Web Tricks

Ogilvy Changes Face After 70 Years

By most terms of reference, 70 years is a long time…70 years ago, copywriter David Ogilvy decided to part ways with his former business partner, Edmund Mather; together, they had made up what was known as Ogilvy & Mather. This decision meant moving from London, where the company originated, to Manhattan, where the name of the company would change to just Ogilvy. Now, as of June 2018, Ogilvy has announced a complete rebranding. For a company that prides itself on “Making brands better” it hasn’t necessarily had it easy. The rebrand has been two years in the making; with the new face lift has come staff changes, new designs, and new financial reporting standards. At the heart of this massive change is a new logotype, design, and colors. All of this can be viewed on its newly designed w...
The Complete Guide to WordPress Performance Optimization
PHP, Web Tricks

The Complete Guide to WordPress Performance Optimization

  According to Builtwith.com, WordPress holds close to 50% of the CMS share of the world's top 1,000,000 websites. As for the ecommerce sphere, we're at 33% with WooCommerce. And if we cast a wider net, percentages go higher. Although we may complain that WordPress can get bloated, resource-heavy, and its data model leaves a lot to be desired, there is no denying that WordPress is everywhere. WordPress can thank its simplicity and a low barrier to entry for this pervasiveness. It's easy to set up, and requires next to no technical knowledge. Hosting for WordPress can be found for as little as a couple of dollars per month, and the basic setup takes just a half hour of clicking. Free themes for WordPress are galore, some with included WYSIWYG page builders. Many look down on...
Web Tricks

Getting Started with Yoga and Prisma for Building GraphQL Servers

  By now, you have probably heard a lot of buzz about GraphQL going around and how it’s going to replace REST but you don’t even know where to begin. You hear a lot of buzzwords about mutations and queries but what you’re used to is GET and POST requests on your different endpoints to fetch data and make changes to your database. Thinking about making a switch to GraphQL and don't know where to begin? This article is for you. In this article, we are going to take a look at how to convert a database to a GraphQL API using Prisma. Prerequisites To follow through this article, you’ll need the following: Basic knowledge of JavaScript Node installed on your machine Node Package Manager installed on your machine To confirm your installations, run the command: node --ver...
Manipulating Pixels Using Canvas
CSS Tricks, Web Tricks

Manipulating Pixels Using Canvas

  Modern browsers support playing video via the <video> element. Most browsers also have access to webcams via the MediaDevices.getUserMedia() API. But even with those two things combined, we can’t really access and manipulate those pixels directly. Fortunately, browsers have a Canvas API that allows us to draw graphics using JavaScript. We can actually draw images to the <canvas> from the video itself, which gives us the ability to manipulate and play with those pixels. Everything you learn here about how to manipulate pixels will give you a foundation to work with images and videos of any kind or any source, not just canvas. Adding an image to canvas Before we start playing with video, let’s look at adding an image to canvas. <img id="SourceImage" src="ima...
Web Tricks

Keeping Node.js Fast: Tools, Techniques, And Tips For Making High-Performance Node.js Servers

  If you’ve been building anything with Node.js for long enough, then you’ve no doubt experienced the pain of unexpected speed issues. JavaScript is an evented, asynchronous language. That can make reasoning about performance tricky, as will become apparent. The surging popularity of Node.js has exposed the need for tooling, techniques and thinking suited to the constraints of server-side JavaScript. When it comes to performance, what works in the browser doesn’t necessarily suit Node.js. So, how do we make sure a Node.js implementation is fast and fit for purpose? Let’s walk through a hands-on example. Tools Node is a very versatile platform, but one of the predominant applications is creating networked processes. We’re going to focus on profiling the most common of these: HTTP...
6 Joomla Extensions We Couldn’t Live Without
Web Tricks

6 Joomla Extensions We Couldn’t Live Without

  We’ve been developing websites using the Joomla CMS (Content Management System) since its inception way back in September of 2005. During this time we have planned, designed, developed and supported hundreds of websites. In this article, I’ll give you the rundown on some of the wonderful extensions that we consistently use during website development. Although the majority of the extensions I detail are paid downloads, we believe that they are well worth the investment. Here are 6 Joomla components we couldn’t live without: 1. RSForm PRO From €19. Rs Form is a form building plugin which is incredibly powerful as well as user friendly to administer. Some of the things we love about RSForm PRO include: Easy drag and drop form building with inbuilt validation options; ...
Web Tricks

Build Custom Pagination with React

  Often times, we get involved in building web apps in which we are required to fetch large sets of data records from a remote server, API or some database sitting somewhere. If you are building a payment system for example, it could be fetching thousands of transactions. If it is a social media app, it could be fetching tonnes of user comments, profiles or activities. Whichever it is, there are a couple of methods for handling the data such that it doesn't become overwhelming to the end-user interacting with the app. One of the popular methods for handling large datasets on the view is by using the infinite scrolling technique - where more data is loaded in chunks as the user continues scrolling very close to the end of the page. This is the technique used in displaying search re...
Animate Images and Videos with curtains.js
CSS Tricks, Web Tricks

Animate Images and Videos with curtains.js

  While browsing the latest award-winning websites, you may notice a lot of fancy image distortion animations or neat 3D effects. Most of them are created with WebGL, an API allowing GPU-accelerated image processing effects and animations. They also tend to use libraries built on top of WebGL such as three.js or pixi.js. Both are very powerful tools to create respectively 2D and 3D scenes. But, you should keep in mind that those libraries were not originally designed to create slideshows or animate DOM elements. There is a library designed just for that, though, and we’re going to cover how to use it here in this post. WebGL, CSS Positioning, and Responsiveness Say you’re working with a library like three.js or pixi.js and you want to use it to create interactions, like mous...
UX Your Life: Applying The User-Centered Process To Your Life (And Stuff)
Web Tricks

UX Your Life: Applying The User-Centered Process To Your Life (And Stuff)

  Everything is designed, whether we make time for it or not. Our smartphones and TVs, our cars and houses, even our pets and our kids are the products of purposeful creativity. So why not our lives? A great many of us are, currently, in a position where we might look at our jobs — or even our relationships — and wonder, “Why have I stayed here so long? Is this really where I want or even need to be. Am I in a position where I can do something about it?” The simple — and sometimes harsh — the answer is that we don’t often make intentional decisions about our lives and our careers like we do in our work for clients and bosses. Instead, having once made the decision to accept a position or enter a relationship, inertia takes over. We become reactive rather than active particip...
Microsoft to Buy GitHub; Controversy Scheduled for This Week
Tech News

Microsoft to Buy GitHub; Controversy Scheduled for This Week

  So yeah, what the title said. Microsoft is buying GitHub for 7.5 BILLION with a “B” US dollars. This is officially this week’s Big DealTM, and everyone’s going to be talking about it. It would not be quite accurate to say that GitHub powers software development as a whole, but it powers a lot of it. GitHub’s friendliness to — and free repositories for — open source software have made it nigh on indispensable for many developers around the world. So now some people are freaking out. People unfamiliar with tech history or the open source world might wonder why. After all, companies change hands all the time. Sometimes that works out for consumers, and sometimes it doesn’t. I personally think it will work out, but I can understand why some people are angry. GitHub’s friendlin...
Web Tricks

Debug JavaScript in Production with Source Maps

  These days, the code you use to write your application isn’t usually the same code that’s deployed in production and interpreted by browsers. Perhaps you’re writing your source code in a language that “compiles” to JavaScript, like CoffeeScript, TypeScript, or the latest standards-body approved version of JavaScript, ECMAScript 2015 (ES6). Or, even more likely, you’re minifying your source code in order to reduce the file size of your deployed scripts. You’re probably using a tool like UglifyJS or Google Closure Compiler. Such transformation tools are often referred to as transpilers — tools that transform source code from one language into either the same language or another similar high-level language. Their output is transpiled code that, while functional in the target enviro...