Category: Mac OSX

Delete files with a pattern recursively using the terminal

This is just a simple way to delete files recursively using your terminal in any UNIX-like operating system: find . -type f -name “FILES_PATTERN” -exec rm {} \; // Example find . -type f -name “*.mp3″ -exec rm {} \; Explanation -name “FILES_PATTERN” : File pattern. -exec rm -rf {} \; : Delete all files […]

Read More

Update Node.js using the terminal

These are just the steps to update Node.js by using your terminal: sudo npm cache clean -f sudo npm install -g n The n package represents a Node helper, and running this command upgrades node to the latest stable version. sudo n stable Just to confirm we can check our version: node -v // Output […]

Read More

My personal .gitignore file

Lesson learned After doing this file many times, I decided to build my personal .gitignore file; I use to add it in my very fist commit as a good practice in every single git repository I create. Currently we are ignoring: Operating systems’ temporary files: Mac OS X, GNU/Linux, Windows. IDEs and editors’ configuration: Vim, Sublime […]

Read More

How to do a “checkout” of a remote git branch

Let’s face it, everyone that loves technology, web development or any IT-related stuff works in teams, the old concept of a programmer/developer alone in his basement is not part of our life anymore, so; the usage of a version control system is a must. As you probably know, I am big fan of what I […]

Read More

Solving Drupal error: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

The problem After downloading a Drupal project I am working on, and importing its database I got this kind of message related with a PDO Exception: Additional uncaught exception thrown while handling exception. PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid […]

Read More

How to get metadata of images in Mac OSX

Today, one of our clients was having an issue with images on iOS devices, so, the first thing they asked us, was about if the images were in the right format, for answering that, we had to obtain the metadata of every single image and see if the extension matched with the real information. So, […]

Read More