Sign in

There comes a time when you just need to display an SVG file.

Photo by Ehimetalor Akhere Unuabona on Unsplash

In your gradle add the following. The version may be different as of writing this.

With this we now have the ability to use an SVGDecoder, that we can use in our composables.

Let say we have a link to an SVG.

Now we need to define an image loader

Then whenever we want to use it we have to pass it to the CompositionLocalProvider. Inside it you define a painter, the rest is classic compose with Image.

This is just one of many in the series of a “Random design and its implementation in jetpack compose beta 08”.

The code and its design might come in handy sometime in the future, might as well share it with others.

Speaking of code, its not pretty, its just to play around. It’s definitely not something anybody wants to ship to production.

Design 1

Using Jetpack Compose alpha08 build. This post will cover how to draw shapes in Jetpack Compose.

Photo by Tetiana SHYSHKINA on Unsplash

Before starting, it’s good to have a grid notebook, something you can just use pen and paper and draw what you want to draw there first. The 0,0 is always in the top left corner. It’s basicly the reverse coordinate system. In a grid of 100x100, the bottom right corner is 100,100. All these examples will use a canvas of 100x100. For each of the example I’m gonna use a little different approach. End result still remains the same.


The most basic way to…

Learn Hiragana and Katakana charaters with some help from plain old JavaScript.

Photo by Jelleke Vanooteghem on Unsplash

We are making a single html page that will display a random Kana — a random Hiragana and its Katakana equivalent.

Data structure

Lets create app.js, it will contain our JavaScrip, data structure and the function to fetch a random kana out of the array.

Our kana variable is an array of objects. Where each object represents a hiragana/katakana pair together with its romaji — english letter.

The “hiragana_info” and the “katakana_info” serve as hints, a simple remined what the kana for each of them kinda looks like.

For example…

Photo by Jonathan Chng on Unsplash

Comparing 3 web frameworks, how fast can they render the message “hello” via a templating engine back to the user. There is no optimisation going on. The premise is:

  • pull the framework
  • create the route controller handler
  • assign a variable with a string message
  • create the view for the template engine
  • render the view back

Load test

Using wrk, since all of them will be on the same port the command will be the same for all. Using 12 threads, concurrent 400 requests for duration of 30 seconds.

wrk -t12 -c400 -d30s

Ruby on Rails

This will be our baseline. Ruby used 2.6.3. Rails…

Sometimes you just need to secure your localhost in order to test some stuff, like OAuth for example.

Photo by Tommy Lee Walker on Unsplash

Create certificate

Creating a certificate for localhost is easy with openssl . Just put the following command in the terminal. The output will be two files: localhost.key and localhost.crt

Click on the crt file, on macOS the keychain app will open, add the key to it.

Now double click on it and under the trust section you will see “When using this certificate” select “Always Trust”.


Now in Next.js we have to create our own server.js file if not already.

Run the server, you now have a secure connection to localhost.

Setting up React with Babel is already available with create-react-app. If you need something configured and just start writing stuff, use that. In this article, we will create our own configuration boilerplate. In doing this we will better understand how these things actually work together.

Photo by Bench Accounting on Unsplash


Setting up working directory. In it, we will prepare the folder structure and some files.


Now we need to install all these packages.


Open config/webpack.config.js and put this content in it. This tells webpack how to work with out files in the src folder and how to bundle them together and deliver them.

Let’s build a simple Rails API and use Netflixes FastJSON library to serialize our JSON responses.

Photo by Tomas Anton Escobar on Unsplash

Project setup

First create a new rails project in api mode.

Then in the gem file add the gems:

Now run bundle install and rails db:create to create the database.

Preparing some data

Create a model called Location, we will use these records for serialization.

And run rails db:migrate to apply the changes to the database. Now we need some sample data. For that we…

A simple painter, where you pick a color from a set of preselected ones. And then paint a grid cell with that color. We will be using React Hooks, more specifically useContext and useState. Context will give our components a context of color, which can be set via useState hook.

Photo by Eddy Klaus on Unsplash


Create a react app, with create-react-app. I’m using the 3.0.0 version. For design layout I’ll use the Bulma CSS. It’s very easy to use.

First, create components and contexts folders. These will contains, as the name already tells us components and contexts.

Usually when somebody thinks chat, they think WebSockets. Normally there are tutorials how you make a server in NodeJs for example and a client in HTML. But in this case the client will also be a NodeJs app. It will display messages from the server and listen to users input with NodeJs readline.

Photo by Pavan Trikutam on Unsplash


There will be no persistence here. A client will see only messages that server sends him from the point he connects to it. Also whenever a client is connected, the server will generate a random color and a random name, and the client will use that. …



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store