Category: Dev Stuff

  • Local executable for Composer

    Last month I learned this little trick for Composer. If you modify your PATH env variable in this way export PATH="vendor/bin":$PATH when you switch project it will automatically load the local executable for the dependency.

  • Do you ask for code reviews?

    Lately I find myself asking for code reviews more often. I used to think exactly as Wiegers put it: Anyone who needs his code reviewed shouldn’t be getting paid as a software developer But that’s not true. Code reviews improve code quality a lot! And, as a side effect, they improve also team cohesion. So […]

  • Redirect HTTP traffic to HTTPS

    Recently I’ve moved all my websites to HTTPS thanks to Let’s Encrypt and Siteground. To redirect the traffic from HTTP to HTTPS I’ve used this rule in my .htaccess file: RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don’t put www. here. If it is already there it will be included, if not # the […]

  • SSH config

    I was really late at the SSH config bandwagon. If you manage a lot of servers you should really give it a try. Here is a nice introduction on SSH config by Joël Perras

  • Merge a branch from a different repository

    I forked a repository from another one, simply taking the files and creating another repository. I was not interested in preserving history, as it would be a completely different project. As always happen, it was not the case. So today I had to merge a branch from the old repository in the new one. As […]

  • Fixing ActiveRecord::NoDatabaseError in Rails

    If you get this error: rails aborted! ActiveRecord::NoDatabaseError: FATAL: database "students_development" does not exist while trying to run rails db:migrate or create a scaffold, remember to run: $ rails db:create before going on

  • Fixing an error installing Rails with PostgreSQL on Ubuntu

    Today while installing Ruby on Rails with PostgreSQL for a personal project, I incurred in this error: Installing pg 0.18.4 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. … An error occurred while installing pg (0.18.4), and Bundler cannot continue. Make sure that `gem install pg -v ‘0.18.4’` succeeds before bundling. As […]

  • Reacting to React: setup a base project

    Reacting to React: setup a base project

    I wanted to have a step by step procedure to have a basic React project to fiddle with, without using some online service like JSFiddle. Maybe I’m an old-fashioned developer, but I like to have the source code for my experiments on my hard drive, always available, even when I’m offline. That’s also why in […]

  • Reacting to React – Episode 2

    Reacting to React – Episode 2

    What to do after following the official React tutorial? My suggestion is RTFM! (React docs) It’s not sexy, it’s not appealing but it’s like medicine: you’ll not like it, but it will make you feel good. I know what you’re thinking: “I don’t need the manual. Show me some code, show me how to make a […]

  • Reacting to React – Episode 1

    Reacting to React – Episode 1

    I have not given to much attention to React as everyone else. I was in love with Backbone and Marionette.js at the time and “My views are fine, thank you. I don’t need yet another view library!”. But in the end, I thought that it was a good time to begin looking at this “JavaScript […]