❯ Guillaume Laforge

Sip a Cup of Java 11 for Your Cloud Functions

With the beta of the new Java 11 runtime for Google Cloud Functions, Java developers can now write their functions using the Java programming language (a language often used in enterprises) in addition to Node.js, Go, or Python. Cloud Functions allow you to run bits of code locally or in the cloud, without provisioning or managing servers: Deploy your code, and let the platform handle scaling up and down for you. Read more...

Deploying serverless functions in Groovy on the new Java 11 runtime for Google Cloud Functions

Java celebrates its 25th anniversary! Earlier this year, the Apache Groovy team released the big 3.0 version of the programming language. GMavenPlus was published in version 1.9 (the Maven plugin for compiling Groovy code) which works with Java 14. And today, Google Cloud opens up the beta of the Java 11 runtime for Cloud Functions. What about combining them all? I’ve been working for a bit on the Java 11 runtime for Google Cloud Functions (that’s the Function-as-a-Service platform of Google Cloud, pay-as-you-go, hassle-free / transparent scaling), and in this article, I’d like to highlight that you can also write and deploy functions with alternative JVM languages like Apache Groovy. Read more...

Machine learning applied music generation with Magenta

I missed this talk from Alexandre Dubreuil, when attending Devoxx Belgium 2019, but I had the chance to watch while doing my elliptical bike run, confined at home. It’s about applying Machine Learning to music generation, thanks to the Magenta project, which is based on Tensorflow. I like playing music (a bit of piano & guitar) once in a while, so as a geek, I’ve also always been interested in computer generated music. Read more...

HTML semantic tags

We all know about HTML 5, right? Well, I knew about some of the new semantic tags, like header / nav / main / article / aside / footer, but I’m still falling down to using tons of divs and spans instead. So as I want to refresh that blog at some point, it was time I revise those semantic tags. Let’s take the little time we have during confinement to learn something! Read more...

Modern web game development

Next in my series of videos while doing sports at home, I watched this video from my colleague Tom Greenaway! It’s about modern web game development, and was recorded last year at Google I/O. There are big gaming platforms, like Sony’s PlayStation, Microsoft’s XBox, Nintendo Switch, as well as plenty of mobile games on Android and iOS. But the Web itself, within your browser, is also a great platform for developing and publishing games! Read more...

Decoding a QR code by hand

Doing sport at home on a treadmill or an elliptical bike is pretty boring, when you’re confined, so to make things more interesting, I’m watching some videos to learn something new while exercising. This time, I found this old video about how to decode QR codes… by hand! Have you ever thought how these were encoded? This video comes from the Robomatics YouTube channel. You recognise easily QR codes thanks to the 3 big squares with the inner white line. Read more...

Defence against the Docker arts by Joe Kutner

Confined at home, because of the corona-virus pandemic, I’m also doing sport at home. I have a small treadmill for light walks (mostly during conf calls!) and also an elliptical bike. I’d much rather run outside though, but I have to use what I have, even if I hate that stationary elliptical bike in my basement. It’s so boring! So to avoid feeling like wasting my time, I decided to watch videos during my sessions! Read more...

Start the fun with Java 14 and Micronaut inside serverless containers on Cloud Run

Hot on the heels of the announcement of the general availability of JDK 14, I couldn’t resist taking it for a spin. Without messing up my environment — I’ll confess I’m running 11 on my machine, but I’m still not even using everything that came past Java 8! — I decided to test this new edition within the comfy setting of a Docker container. Minimal OpenJDK 14 image running JShell Super easy to get started (assuming you have Docker installed on your machine), create a Dockerfile with the following content: Read more...

Serverless tip #7 — Create mini APIs with Cloud Functions and Express routing

Requirements: an existing Google Cloud Platform account and project Cloud Functions should be enabled for that project Compared to the previous tip when using Exress’ request path attribute, we can take advantage of Express routing. So to support the following paths: https://us-central1-myproject.cloudfunctions.net/api/customers https://us-central1-myproject.cloudfunctions.net/api/customers/32 https://us-central1-myproject.cloudfunctions.net/api/customers/32/address We can have our functions require Express by adding Express in package.json: { "name": "mini-api-router", "version": "0.0.1", "dependencies": { "express": "^4.17.1" } } Then we can require that dependency in our new functions script: Read more...

Serverless tip #6 — Create a mini web API with Cloud Functions

Requirements: an existing Google Cloud Platform account and project Cloud Functions should be enabled for that project We often use individual HTTP Cloud Functions as a single endpoint, and we pass data to the functions with either query parameters, or via a POST body payload. Although it’s a good practice to keep the scope of a function small, however, you can easily write mini Web APIs for a given function, with different paths for different needs, like with usual Web frameworks. Read more...