GeoJSON
Spring
Hibernate
Liquid
Karma
Deploy
SASS
REST
Upgrade
Boot
Spring
Consume
Visualize
React
Angular

AWS had a little lambda

AWS Lambda

I recently had the opportunity to develop a serverless application with the use of AWS Lambda and API Gateway. It was my first introduction to the technology. My coworker suggested the solution as a way to keep cost down for for hosting a relatively simple  REST API needed for multiple other services in our main application. We started with a Spring Boot Java application connected to DynamoDB in a docker container. Then we created a Lambda file to define the API endpoints. A Lambda file in this case is was a single Java class with methods for each endpoint which is basically the same thing as a traditional Spring Boot Controller. The Lambda file called an additional service file to do the core logic which also depended on a CRUD Repository file that integrates to DynamoDB. This Lambda project is deployed to AWS via a serverless.yml file that defines the paths and parameters for the Lambda file. The challenges I faced were mostly learning to use AWS API Gateway and serverless.yml. We used the original spring controller to debug during development. Once we got it working it seemed rather simple though. 

more...

A new Vue on things

A new Vue on things

Vue is another Javascript framework for frontend app development much like React and Angular. I started playing with it one weekend and put together a basic full stack application from some samples I found on the internet. I crafted it into the app it is now. You can see the source code at https://github.com/jonclawson/vueapp.

more...

Reacting to the state of Javascript

ReactJS

React is a popular Javascript library that you may have heard of mentioned along side of other frameworks such as Angular and Vue. I would say that it's appeal that it is more like writing Vanilla Javascript rather than learning a complex framework such as Angular. Of course, most React apps are accompanied by Redux, a predictable state container that uses the FLUX pattern of actions passed through a single dispatcher in order to control the state of the application. Together Redux and React combine to provide a light weight and stable framework for building applications. Being supported by Facebook makes it a creditable solution in app development until something new comes along. 

If you compare the weekly downloads of react vs @angular/core, you may determine that React has become more standard in JS app development. So you may want to go with React if starting a new application, so that you will be able to hire the best and brightest young devs to build your business. 

more...

Angular & the Future

Angular & the Future

Since it's birth from the Summer of Code in 2007 Angular has taken the industry of JavaScript Applications by storm. Rising to the top with a full feature component based framework including controllers, models, directives, dynamic 2-way binding with it's own rich template engine, CSS plus an extensive community of developed and maintained plugins for routing and other solutions for your app project, Angular is here to stay owned and maintained by the world technology giant Google.

So I am not sure where it all started but a few years ago Backbone.js came out and then Ember and React and there are quite a few of these new JavaScript MVC libraries today. The reason I believe Angular will continue to dominate the market is for the same reason we all build our websites to satisfy the gate keeper of the internet, Google. Google created Angular and it has taken the development industry by storm. When I search the market for jobs, I see the most highest payed jobs with Angular in the description. Maybe it's just a trend and things will even out, but I've yet to see a search engine compete with Google. Also as an employer, I want to build my apps with a technology that the market can provide a good selection of applicants so I don't get stuck searching for employees that know how to work on my app.

more...

Message Writer

Message Writer

I have been working I18n localization. It has caused me to need to generate large list of messages in JSON, YAML and Java properties. So I got creative and made this little app to generate them. I call it Message Writer.

more...

Spring is time to boot up

Spring Boot

Well it was a long cold winter and I have been in deep with the JavaScript. Now that spring is here, I am booting up with some good old Java Rest because I would like to do some more backend development now. I've done backend work here and there through out my career, but really need to to do more Java. 

So I put together a simple REST API in Spring Boot with authentication that could be used to start any project. I like JWT personally over other methods I have used in the past. This simple api lets you register, login and create and edit post articles. I set it up with the database with Docker for easy installation.

more...

$compile for the latest Angular version

At work, I was faced with the challenge of upgrading an AngularJS app with heavy use of $compile to the latest version of Angular which has no out of the box solution for compiling a template string that includes other components. So after much research I developed this component. Of course, I forked the main concept from another developer's sample posted overstack (https://stackoverflow.com/a/53739133) and I added the context input. It was hard to find on the internet, so I hope that others will benefit from this code. Enjoy.
https://mx-bind-html-compile.stackblitz.io

more...

Down by the Ubuntu Docks

Down by the Ubuntu Docks

Virtualization has been a big part of my business for the 15 or so years. I used Virtual Box pretty heavily for my development environment. A few years ago, this thing called Docker emerged and I heard a lot of good things about it but I never got around to trying it as Virtual Box worked pretty well and taking the time to setup up a new environment with a foreign tool was just not on my priority list. Then a few weeks ago, I installed it and poked around with it and found that it was pretty easy to setup compared to a virtual box image. Surprisingly, I can run a single command and spin up a fresh ubuntu image or just a MySQL container. I have only just gotten started, but I am pretty impressed with the ease of this new tool. 

With this simple command, I can create and Ubuntu image with my desktop mounted inside of it.

docker run -t -i -v ~/Desktop:/Desktop ubuntu /bin/bash

Inside the container:

apt install [anything]

exit

Find the id of the container just created:

docker ps -a

Save a new image from the container:

docker commit [container id] [new or existing image name]

Now run the container by name you just committed to confirm your changes.

more...

Are you afraid of snakes?

Python, Selenium

Have you ever wanted to create end to end tests for your app, but just can't find the time to get those tests working. Well, I have tried several frameworks from Cypress, to Selenium. I have always felt like this technology ought to be made simple. Just recently after taking another look at Selenium, I found the IDE to be very easy to use in order to quickly create scripts that could be improved by hand later. Here is a very simple example.

First I installed the Chrome Selenium extension.

https://docs.seleniumhq.org/selenium-ide/

I created a simple test using the record button and exported it as a Python test.

Then I installed the Python Webdriver using 

 
apt-get -y install python3.6
apt-get -y install python3-pip
pip3 selenium

Next I installed the chromedriver and I used NPM

 
npm install chromedriver

Now make sure you have Chrome installed. I used Headless on my server.

I may have added source first

 
apt-get -y install google-chrome-stable

Then I ran the following script with this command.

more...

Fun With Numbers

See the Pen Fun With Numbers by jonclawson (@jonclawson) on CodePen.

React Version

See the Pen React with Numbers by jonclawson (@jonclawson) on CodePen.

Angular VX

See the Pen Angular 6 starter by jonclawson (@jonclawson) on CodePen.

I had some free time last Saturday, so I decided to play with d3.format() and created an AngularJS number filter for formatting numbers in common formats you might see on a website or application. This is what I came up with.

Just to be fair, I decided to make a React as well as an Angular 6 version too.

more...