Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Extend Legacy Java Android Applications With NativeScript And Angular

As some of you might know, before I started developing cross platform mobile applications using Ionic Framework and NativeScript, I was developing Android applications using nothing more than the Android SDK and Java. I still have one of my first applications, SQLTool, for sale in Google Play, and it was written with Java and Android. When building mobile applications, frameworks like NativeScript are incredibly attractive to web developers because they can use a common set of web design and development skills. However, NativeScript can be equally attractive to development teams writing Android applications with Java.

With NativeScript you can actually build a “polyglot” type application where parts are Java and parts are NativeScript with Angular. To be clear, I’m not talking about rewriting your Java application into modules wrapped in JavaScript like plugins. I’m saying that you can take your 100% Android with Java application and add Activities or Fragments built with NativeScript.

So why is this useful?

Imagine being on a small Android development team with more things to be done than there is time in the day. These Android developers would rather die than use a cross platform framework, but you have plenty of web developers floating around your company. In this scenario, the two worlds can collide and maybe the web developers can create lower (or higher) priority components for the Android application without having to convert the whole application to Android with Java or to NativeScript with Angular.

Read More

Remove Untagged Docker Images From Your Docker Host Via The CLI

If you’re like me, when it comes to Docker, you probably build images non-stop. I must admit that when I create images, I don’t create any special tags, even though I should. Instead every build uses the latest tag because that is enough to meet my needs. Regardless of what tags you use, you may find yourself building the same thing over and over. When this happens, the previous image remains on your machine, but becomes untagged to make room for the new build.

So how do you prevent having potentially hundreds of untagged Docker images lingering on your machine? We’re going to see how to quickly remove them.

Read More

Add Two-Factor Authentication To A Golang RESTful API

When it comes to authenticating users for making use of your API, it is a good idea to add an extra step beyond standard username and password. This is called two-factor authentication (2FA) and it acts as a second layer of security for users making use of your application.

Not too long ago I had written about adding 2FA to a RESTful API created with Node.js and Express Framework, but what if we wanted to do it in Golang? The logic isn’t any different, just a new syntax for a new language.

We’re going to see how to add two-factor authentication to a Golang API that makes use of Json Web Tokens (JWT).

Read More

Using Network Sockets With The Go Programming Language

A few months back I wrote about using websockets in a Golang application for communication with an Angular client web application. While very useful and simplistic, in many cases websockets won’t be the means for real-time communication between applications. It is often easier or better to use standard TCP network sockets as an alternative. For example, if you’re developing an online video game, it will likely communicate to the server using TCP sockets rather than websockets.

We’re going to see how to create a basic chat application using the Go programming language. This chat application will have a server for listening and routing client communications and a client for sending and receiving messages from the server.

Read More

Form Validation In An Angular Web Application With Custom Directives

When creating a web application that accepts user input, it is often a good idea to validate anything the user provides. While you should always validate this information via some backend server-side code, it often provides a good user experience to validate via the frontend as well. By doing form validation on the frontend, you set yourself up for the possibility to catch and display errors before form submission.

If you’ve been keeping up, I once demonstrated how to do form validation in AngularJS via an Ionic Framework application. As of now, AngularJS is ancient technology, so we’re going to see how to do the same with Angular. However, we’ll be seeing from the perspective of a web application, rather than a cross-platform hybrid mobile application.

We’re going to be basing everything in this guide off a new project created via the Angular CLI. This means that you should have installed the Angular CLI before going forward.

Read More

Create A Raspberry Pi Cluster With Docker Swarm And Raspbian Linux

Back when I was first learning about Docker, I had tried to use it on one of my Raspberry Pi devices. This was when Docker had first become available officially for Raspbian. When I was playing around with Docker and my Raspberry Pi, I had written a tutorial for deploying containers, or more specifically a Ghost container. This was a single container on a single device or node. Since then I started playing around with Docker Swarm and decided to create a Raspberry Pi cluster.

We’re going to see how to take several Raspberry Pi devices, cluster them using Docker Swarm, and deploying containers to Swarm with replica copies.

Read More

Bulk Remove Unconfirmed Sendy Subscribers After A Certain Number Of Days

You may or may not know this, but I use Sendy to send out my monthly newsletters because it is incredibly cheap in comparison to competitors like Mailchimp. Anyone who has done list building before knows that over time you’re going to end up with a lot of stale subscribers that need to be cleaned in an effort to save space and keep things organized.

My email lists require a secondary opt-in to prevent SPAM subscriptions. The problem with this is I still get a lot of SPAM subscriptions even if they are never included in my newsletters. These subscriptions have no business being in my list, so it is best to remove them after so long.

We’re going to see how to use SQL to remove unconfirmed email subscribers in Sendy after so many days.

Read More