Mastering FP and OO with Scala

Making use of functional and object-oriented programming on JVM

Oh My Zsh's Plugins to Boost Happiness From Using Git

| Comments

From the website of the very useful and must-have addition to your terminal - Oh-My-Zsh:

Oh-My-Zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…“Oh My ZSH!”

As I’m using the ZSH configuration framework so often that I can’t believe I could’ve lived without it for so long here’s a collection of the plugins to cut the number of keystrokes while working with git repositories. To my great surprise there are quite a few plugins for git and the list below is my humble summary to get it remembered as much as to spread a word (as I’ve been meeting people unaware of Oh-My-Zsh far too often).

FIXME Consider the blog post complete after the line’s gone. It’s always in readable state, though.

REST Clients (for Working With REST Microservices)

| Comments

It’s so engaging to learn things while learning others. So is the case with the new architectural style REST microservices and developing them using Scala language and tools.

As there are a lot of REST interactions – sending requests to and receiving them from REST microservices – as much as I’m not really in need to comprehend every bit of the communication format, I do need tools to work with them effectively, i.e. be able to create and consume HTTP packets with JSON payload with little to no effort.

Loose Notes About Cassandra

| Comments

I’ve got curious about Cassandra and more and more I’ve been asking myself about the use cases it could be the most valuable solution for. With all the answers out there, I simply needed a place where I could dump the findings to ultimately build something useful as a single page (and perhaps ditch it to create something of a higher value).

So here they are, loose notes about Cassandra to understand the value propositions of the database and where it could fit well. Should I ever be faced the question of using Cassandra or not, I may some day find an answer here (or know where to look for it).

Getting Started With Play Framework and AngularJS - Day 1

| Comments

Let’s face it – there are tons of very good tutorials about how to get started with Play Framework and AngularJS to build modern web applications, and despite the fact there are still quite a few people out there who keep asking me about writing mine. Since writing tutorials is a way to clear up understanding of a topic to me, I found it very compelling to help myself and others using the two - Play and Angular - properly. Well, the properly part comes with your comments when I fix the parts that are outdated or plain wrong.

So, here it is. The yet another tutorial series about developing web applications in Play Framework (with Scala) and AngularJS (in JavaScript). Let’s get rolling!

NOTE It’s a work in progress. Watch this space until the note has disappeared and the blog post become feature-complete.

JSON in Play Framework With JsValue and Reads

| Comments

There are many ways to learn the Scala programming language and the vast number of libraries for the language. Mine is to use sbt console in a customized project with required dependencies that are automatically downloaded by sbt. All (analysing, downloading, setting up CLASSPATH and such) is handled by the tooling itself not me. Share your approach if it appears smarter.

In this installment, I’m presenting a sbt build for learning the JSON API from the play-json module in the play.api.libs.json package in Play Framework 2.4.0-M1.

Trait Init[Scope] in Sbt

| Comments

It’s been my wish to master Scala recently and since I’ve been spending more time with sbt I’ve made the decision to use one to master the other (in no particular order). There are quite a few sophisticated projects in Scala out there, but sbt is enough for my needs.

In order to pursue my understanding of sbt (and hence Scala itself) I’ve been reading the sources that honestly keep surprising me so much often. It’s almost every minute when I find myself scratching my head to digest a piece of sbt code. It’s akin to when I was reading the source code of Clojure to learn the language. People can write complicated code and I wouldn’t be surprised to hear sbt’s sources belong to the category. I don’t care, though. I’m fine with the complexity hoping the mental pain brings me closer to master Scala.

Today I picked the trait sbt.Init believing it’d be an important step in my journey.

NOTE It becomes feature-complete when the note disappears. Live with the few mistakes for now. Let me know what you think in the Comments section. The site is on GitHub so pull requests are warmly welcome, too. Thanks!

Contributing to Open Source Projects on GitHub - Cheat Sheet

| Comments

I’ve been contributing to many open source projects over the past couple of years and I found GitHub pleasantly helpful to continue the gig in the years to come. I’ve learnt few techniques along the way (from many sources I’m including after the section they appply to).

I don’t want to keep the techniques for myself so the git/GitHub cheat sheet is supposed to help me remember the commands and others to learn from my mistakes (aka experience). It’s so easy on GitHub that I keep wondering why it took me so long to learn it. It must not for you.

Have fun contributing to open source projects as much as I do! Pro publico bono.

NOTE It becomes feature-complete when the note disappears. Live with the few mistakes for now. Let me know what you think in the Comments section. Pull requests are welcome, too. Thanks!

Calculate Profit in Scala With foldLeft

| Comments

With a credit in a foreign currency one may want to hedge to offset the foreign currency getting stronger, and hence increasing the cost of the credit.

Say, you bought 589 CHF when it costed 3.4007 PLN and then 593 for 3.3704. How much would you profit when the price of selling CHF rose to 3.4107 PLN?