Page 9 of 11

Basic concepts on feature toggles, feature flags Aug 27 2018

There are simple concepts that can significantly improve our projects, one of these concepts is Feature Toggles. In this post, I will explain the basic idea behind Feature Toggles and a basic implementation example.

Feature toggles (aka, flags, flippers, bits), in simple terms, are a way to control the flow of our code and make decisions to run specific versions/implementations of it. What this means is better understood by an example, so let’s get to it.

Read More...

Basic developer setup Aug 20 2018

I have always been fascinated by other professions that have physical workshops, imagine a room full of neat rows of tools, with everything at hand, just having everything on its own places makes you want to create and build new things with your tools. The same applies to software, we should have all of our tools clean and sorted, we should know where everything is and where to expect to find a piece of configuration we need to modify.

Read More...

How to add RSpec to an existing Rails engine Aug 13 2018

Update 2018-08-27

I ran into a problem with Rails, it couldn’t find a database.yml, this was not because of a Rails missconfiguration but because of the binstub for rails had:

1
APP_PATH = File.expand_path('../../test/dummy/config/application', __FILE__)

And well we change it to use rspec, so it should be:

1
APP_PATH = File.expand_path('../../spec/dummy/config/application', __FILE__)

Adding RSpec to an existing Rails engine

If we already have a Rails engine and we wish to add RSpec to it, how would we go about it? The solution is not as straightforward as we might think, there are a few details always missing from tutorials or the guides, so I’ll try to share what I found and hopefully help someone that has the same issue.

Read More...

Innovation in legacy projects Aug 6 2018

Let me start by stating that all code is legacy code, the difference is in how we perceive it, and like with everything else, is only a matter of perception. There is more focus on the “new” but working on something new is not the only path to innovation. I’ve heard people wanting to work on the edge of the field bringing new development and improvements to the industry. Well, here is the trick, innovation is not tied only to new projects, innovation and improvements can occur on already existing projects, the only limitation to innovation is how we approach each problem.

Read More...

Find command for the million Jul 29 2018

One of the most useful Unix commands, and mostly underutilized, is find. To get the most out of it there are two key features that we need to explore and understand.

  1. How to iterate over the results
  2. Limitation on the number of results we can operate on

Learn by doing

Lets create a few files and directories to use as examples:

Read More...

Git general workflow Jul 23 2018

The following is a basic git workflow that handles most users needs:

The big picture:

We will have the following branches on our repository:

Workflow:

Sprout a branch from master to work on your feature.

Read More...

Bash prompt customization Jul 16 2018

Bash when is executed as interactive, uses environment variables to define how the shell prompt looks in different scenarios. One of those variables is PS1, this variable is used to define the prompt displayed when the shell is ready to read a command(this is the one we will normally refer to when we say we would like to customize our prompt).

There are more variables like: PS2 is displayed when the shell needs more input to complete a command, or PS0 that is displayed after it reads a command but before it is executed. But we will only focus on PS1 just now, there is more information on the man page of bash (run the command man bash and search for PS1).

Read More...

Rails update only one gem with bundler Jun 6 2018

When we use:

1
bundle update specific_gem

We expect to only update one gem the one we are telling bundler to update but that is not the case it updates the gem and all its dependencies, and if the dependencies have updates but the gem doesn’t the dependencies get updated no matter what.

so to avoid that use:

1
bundle update --source specific_gem

And that should do the trick.

Read More...

fish-shell setup Mar 13 2018

I’m giving Fish shell a try, you can grab my set up from github (fish setup).

There are a few details worth pointing, most of the configuration is done by the functions inside:

1
$HOME/.config/fish/functions
1
2
3
fish_prompt.fish
fish_right_prompt.fish
fish_mode_prompt.fish # if you are using vi mode

Use fisherman to manage your plugins

Read More...

Docker WordPress setup for local development Mar 2 2018

Development environment will use: WordPress latest - the image uses Apache MariaDB latest

I would like to keep the WordPress files in the host machine so I can tinker with them so we’ll be using a mount defined by the environment variable: WPHOME

so let’s say we have the following directory schema:

└── wordpress-development
    ├── WordPress/
    └── docker/

inside the docker directory is where the docker-compose.yml (you can see the docker-compose file at the end of the post) file is located, so the command I will run to bring the containers up will look like this for my example: $ WPHOME=../WordPress/ docker-compose up -d

Read More...

$