Just Some More Devs Ideas

By Emiliano Zilocchi

Managing Sidekiq With Upstart

| Comments

This post has started as a research on How to start Sidekiq on a system reboot. After read blogs and try different approaches we ended with Upstart, that is the new way of managing jobs on the Ubuntu platform (Actually not so new, it was included on the standard releases since 10.04 I think). With it you basically define a standard Ubuntu Job and then you can just:

1
sudo service sidekiq [start | stop | restart | status]

We have a quite standard Rails stack that involves:

  • Ubuntu 12.04 LTS
  • Sidekiq with Redis
  • RVM to manage our ruby versions (with rbenv you can use the example on the official sidekiq github repo)
  • Capistrano for deploying the application

Getting Started With Octopress

| Comments

This is just some thoughts after my experience of migrating my blogging platform from Wordpress to Octopress. For those who have never heard about it, Octopress is basically a tunned Jeckely for hackers with a set of plugins ready to use. The big goal of these blogging platforms is that you can write your posts using Markdown language instead of plain HTML or some word like editor (If you are used to write github README.md file, you will love it!). In this way it transforms the act of writing a post into a programming experience.

You can find the installation and deployment instructions at the official website.

Things that I did right after the standard installation

  • Set aside config for different pages.
  • Configure some built-in Octopress plugins.
  • Enable comments through disqus.
  • Create and configure a Google Analytics account.
  • Configure the about me at the right side bar.

Getting Started With Puppet and Rails

| Comments

This is just an example project showing how to get a Ruby on Rails environment up and running with just one command line using Puppet. It was original created for (but it can be easily modified to run with other setups):

  • Ubuntu 13.10 (since it’s one of the most supported distros in the linux community)
  • Rbenv as Ruby manager (there is no way of developing ruby without a Ruby Version Manager. You can user RVM as well)
  • Postgresql (since it’s 100% open source and it’s the heroku default)
  • VIM (with janus distribution)
  • Nodejs (since it’s the most popular and stable JS engine)
  • Git (it doesn’t need any explanation)

Any contribution to improve it (like proposing a better way of writing the config) or add more features (like supporting others linux distributions) is very welcomed :).

So basically you can run this command from your terminal:

1
sudo curl https://raw.github.com/ezilocchi/my-puppet-conf/master/install.sh | bash

or you can go to the github repo and see how it works

Line Too Long on jsLint and jsHint

| Comments

This is just another approach to fix the famous Line too long on JShint or JSlint complain.

NOTE: this started as an answer for this Stackoverflow question.

The thing is what to do with those long strings that throw a Line too long complain but it still makes sense to have them in that way. Think in examples like an URL or a HASH / SHA.

First of all, it’s important to agree that there is no “one solution” for this situation and second of all that it’s a matter of design more than a technical issue. It’s true that sometimes it makes sense to split these kind of strings into several lines, such as HTML code representations, but sometimes it doesn’t as in the example of an URL, a HASH / SHA string or even paragraphs.

Getting Started Rails 4 With Mongodb

| Comments

Introduction

The idea is to create a Ruby on Rails application from scratch, that connects with MongoDB. The gems involve are:

  • MongoID: To integrate Rails and MongoDB
  • Slim: An alternative template engine to ERB (the Rails default one).
  • Rspec: A BDD gem to express the tests as specifications
  • Cucumber: A BBD gem to express the acceptance tests in Gherkin Syntax

NOTE: You can find the source code for this tutorial here

Technology Stack: MongoDB, Ruby, Rails, GIT (Optional), VIM (Optional)

Installing RVM on Ubuntu

| Comments

I have recently started to work on a Ruby on Rails project which is composed by different subsystems under a RESTful architecture. The thing is that every piece in the whole picture has different deployment characteristics, for example some of them use ruby 1.8.7 some others use ruby 1.9.3 and even the ruby interpreter could be different (ruby RMI or ree for example). So imagine that you have to work with all these projects at the same time in the same work station, even for a single Story you you might jump between them. So the idea is to find a way to deal with all these infrastructure issues in just one dev machine without pain.

So here we have one amazing tool that makes this process much easier: Ruby Version Manager (RVM)

Note: This tutorial was written based on an official RVM site and shows how to do it for Ubuntu 12.04 but it should also works for other Ubuntu versions.

IMPORTANT: The RVM alternative is rbenv, if you want to try it check the rbenv-installer