avatar

Andres Jaimes

Undoing the Last Git Commit

A command so important, it deserves its own page:

git reset --soft HEAD~1

The previous command undoes the last commit to git. I think this is one of those commands that I have typed many times during the last year. It’s very important to know …

Testing scala classes and controllers

This article discusses different approaches for testing classes, services, and PlayFramework controllers using scalatest.

Setting up the project dependencies

First step is to add to build.sbt the next dependency:

"org.scalatest" %% …

Enumerations

Using case object

Unlike other languages, Scala does not have a keyword for enumerations. One way to implement them is by using case objects. For example:

sealed trait OperatingSystem extends Product with Serializable

object OperatingSystem {
  case …

Installing Rancher on Ubuntu/Docker

On this article we are going to install a rancher server on Ubuntu. Let’s start by getting the rancher image from docker hub:

sudo docker run -d --restart=always -p 8080:8080 --name=rancher-server rancher/server

Go to http://ip-address:8080 and …

From MySQL to Postgres - Useful commands

This article shows a list of basic commands on MySQL and their corresponding versions for PostgreSQL.

Connecting to a database

MySQL

$ mysql -u root -p

Postgres

$ psql -h <host> -U <username> <database-name>

Try the following if you …

Ideas for successful software projects

This article describes some ideas on getting a successful software development process.

A successful project:

  • Depends on the expertise of the team. Don’t try to push many new technologies into a project. It will be difficult for the team to …

Storing MySQL credentials on a file

MySQL allows you to store credentials in a file called ~/.my.cnf. The contents can look like this:

[mysqldump]
user=myuser
password=mypassword

We have to modify the file permissions and give read/write permissions to the owner only:

chmod 600 …