HowTo

How To: search with grep

Posted on

To search through text you can use the grep command. It searches files and returns the lines of the file that match a certain string. The command has the following format: grep [options] pattern [file]     Here are some of the useful options I use:   Examples You can also search multiple files eg. all files […]

AWS

Kinesis

Posted on

Kisesis Data Streams is the real-time data streaming service that AWS provides.   AWS provides a couple of great tutorial to get accustomed with Kinesis.   If you are new to Kinesis I would start out with this tutorial: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis-example.html create a kinesis stream make a lambda function listen on the stream put events on […]

OCP

OCP: Functional Programming in Java

Posted on

Java8 revolutionised Java programming with the introduction of functional programming. Here is a little quiz (you ‘ll find the answers below): 1 . What is the name of the abstract method of the Consumer interface? A. apply B. accept C. test D. get   2 . Which method can you call on Optional to perform […]

Python

Python fun!

Posted on

Recently dove into Python and wanted to share the fun!   Playing with the Chuck Norris API and writing chuck quotes to a file: import requests URL = ‘https://api.chucknorris.io/jokes/random’ outFile = ‘chucknorris.html’ open(outFile, ‘w’).close() with open(outFile,’a’) as o: for i in range(1000): json_response = requests.get(URL).json() o.write(‘<h4>’ + json_response[‘value’] + ‘</h4>\n’) print(json_response[‘value’])   Surrounding each line […]

OCP

Collections: Did you know ..

Posted on

Did you know: that LinkedList implements both Queue and List that this means you can remove and add items from the beginning and end of the list in constant  time that you should use  ArrayDeque instead of Stack that a Set does not allow duplicate entries that a HashSet uses hashCode() to store its entries […]

AWS

CloudFormation

Posted on

I wanted to compare CloudFormation and SAM with Terraform which I know from work. The following tutorials are really great if you want to get started with CloudFormation: How CloudFormation works — by tongueroo: Youtube BlogPost Getting started with AWS SAM — by Foo Bar: Youtube For a deeper dive, more info and sample templates:  AWS docs

OCP

Generics

Posted on

Did you know that: classes used as generic type parameters possibly have nothing to do with each other. public class Store<T>{…} Store<Candy> candyStore = new Store<>{}; Store<Animal> animalStore = new Store<>{}; Type erasure is removing the generics syntax from your code at compile time. public static <E> boolean containsSomeThing(E [] listOfThings, E someThing){ for (E […]

App

Angular – Guestbook

Posted on

Summary Guestbook-angular-app As a developer it is good to know about frontend and backend development. Since I do mainly backend stuff during my day job, I decided to familiarise more with Angular. I took the guestbook (https://nickvanhoof.com/a-lambda-guestbook) and decided to also make it available as an Angular app here. As usual you can find the […]