ki is a Kotlin Interactive Shell developed by the folks at JetBrains.
One of my colleagues recently shared a neat little Ruby script to get an ad-hoc localhost webpage up and running with all deeplink URLs.
We’ll be doing a similar exercise with ki.
Even though ktor would be the popular choice for this article only for simplicity sake (number of modules to be loaded to get things up and running), I’ll be using
Javalin as the web framework of choice.
A very helpful feature of ki is that you can import libraries on the fly. Let’s import javalin…
This article is #8 in Goodpatch’s Advent Calendar 2020🎄.
2020 has been tough for everyone. We are eagerly waiting for it to conclude and the good thing is we’re almost there! Since it’s getting pretty chilly around here, I thought it would be nice sharing snippets of few of my Jetpack Compose implementations as I sip over a Cup of Hot Chocolate playing Monster Hunter XX on my Switch.
Just a heads up, I will be updating this article timely as I share few more snippets in the future as Compose keeps growing.
Also, the snippets I am sharing aren’t…
While I was going through on how to make HTTP calls in Swift with Alamofire and subsequent URLSession tutorials, the HTTP calls looked something like,
While Alamofire does a pretty impressive job in cutting down a lot of the boilerplate, I soon realised that for projects with a lot many HTTP calls, maintenance of the API functions could be a lot easier if the generation of the Request URL and processing of response in
completionHandler are separated.
Being an Android developer, I’m very used to how Retrofit (Android’s goto Networking Library) lets us separate the HTTP call URL generation…
In most cases, we use
Toolbar as follows
where we set the title and title’s style in the layout xml itself.
Let’s consider the following use case:
Of recent I’ve come across AppleScript and its niceties. It’s a neat scripting language one can use to get tasks done on your macOS devices. There are some very good resources for learning AppleScript. This is going to be couple of articles I discuss how I came about making an MVP version of a Password Manager using AppleScript.
Part 1 is about the core mechanism of a functioning Password Manager i.e., Password Generation, storage and retrieval.
Part 2 will be how all these can be put together as an Application.
For password generation logic I’m keeping it pretty simple. Out…
I was reading on Haskell and came across three terms in the functional programming universe,
Monads. There’s a very well written & illustrated article on the three. I’ll be using the images from this article and explaining about the three in
Suppose we have the following datatype which acts as a container to a
value and we have a normal function which adds 3 to an
data class Something<out T> (val value: T)fun add3(x: Int): Int = x + 3
Now, there’s no way we can implement
add3(value) outside the context of
Kotlin, with all the wonderful magic dust it has sprinkled over us Android Developers, has lot going on underneath. This article takes a look at some of the interesting Kotlin Bytecode generated when you write your beautiful Kotlin code.
Let’s take a look at a string formatting example,
Here, we see that when we do a string formatting, underneath it gets converted into a
StringBuilder.toString()and all the non-string parts are appended.
Let’s take a look at
companion object which is widely used when we want
public static final constants.
We can globally access
Android Developer. 日本語勉強中。한국어를 공부하고.