Report inadequate content

18/10/2014

OS X renaming using parameter expansion

When it comes to rename files via command line there is no rename utility under OS X without installing Homebrew. But I still never needed to install it since there is a lot you can do by just making use of the shell parameter expansion.

The parameter expansion allows you to manipulate variables in a very convenient way and when mixed with the mv command you have an...

{
}

!About the blog

Harecoded is a software development blog. The contents here are very basic and tending to be generalistic recipes, some tricks and a little bit of advice. If you are in a startup or start digging into the internet development there are some posts that might be handy.

I usually do not go deep into the issues and my dedication to this blog is barely unexisting. I write randomly when I think something is of general interest, keeping only the very essence.

Historically this blog has been contributed by more people (Sergi Ambel and Manuel Aguilar) but now is managed only by me (Albert Lombarte) , the original owner.

 

If you have questions please use the comments to post any of them! What we write is quite basic but we can help you out with more complex stuff.

Thanks for reading!

Read more about this blog in Obolog

1/10/2014

Merging two, three or more git repositories keeping the log history

If you ask anyone, merging several git repositories into a single one would usually be considered a bad strategy: as a rule of thumb, your code base should have several components isolated and then use a dependency manager (e.g: Composer) to bring them together.

Nevertheless, there are always many different scenarios and with them come different use cases, weird situations...

19/09/2014

Terminal tuning for Git developers in Mac

If you work with Git in the terminal there are some tweaks you might want to apply to your prompt for safer and faster coding. The following lines are part of my ~/.bash_profile file. I use it on Mac although that might work in Linux as well.

You can copy and paste this code in your ~/.bash_profile (create it if it doesn't exist), save and open a new terminal to see the...

23/07/2014

VCL's Varnish syntax highlighting for PHPStorm

If you are looking for Varnish syntax highlighting for PHPStorm, as per today, you won't find a plugin. This post is not publishing a plugin for proper vcl syntax highlighting but a quick hack to see some coloring.

Given the fact Varnish configuration files are very similar to C I tried to associate the .vlc type to C files.  It is not rocket science but at least your eyes...

{
}

2/07/2014

Solved: Firefox and IE blocking font awesome (CORS)

It seemed today that Firefox was blocking the font files when using font-awesome and the web didn't work properly. But our friend Jorge from the Sphinxdev blog explained us a solution..

In order to enable automatically CORS when a TTF, OTF, EOT or WOFF file is detected you only have to create a .conf file insde /etc/httpd/conf.d with any name and paste inside:

AddType...

10/12/2013

Organizing git branches in logical folders

It is easier to find things when they are well organized. If you are a git user a good practice to name the branches would be to use descriptive names including slashes "/" (as in paths) where everything before the slash is the folder you want to use and then the logical name after it.

If you use the fantastic git graphical interface SourceTree (free for Windows and Mac)...

6/12/2013

Automatically archive S3 backups to Amazon Glacier

Amazon S3 is an on-cloud storage service used in a variety of scenarios. On of these common scenarios is the one where you upload your server backups to S3 using any of the multiple convenient libraries and tools. 

In the other hand, Amazon offers another service more oriented to data archiving and backup named Amazon Glacier. If you store a lot of data (and I am not ...

23/11/2013

Kill processes using string search

A lot of Linux distributions (and Mac) come with a handy command named pkill installed by default. This command is very useful to kill processes in a more natural way.

Instead of doing a kill/killall based on the ID of the process or the binary name, you can just pass a string that appears in any part of the process list, including the parameters you used to start a...

16/09/2013

Force kill of processes in Windows

Sometimes Windows Tasks Manager is not able to kill an in-memory process. We try to close it several times with no luck :(

For these frustration moments we can make use of a console command named TaskKill

With TaskKill the pain ends simply with:

taskkill /IM filename.exe /F

More info about taskkill: http://technet.microsoft.com/en-us/library/cc725602.aspx

8/08/2013

A true multiline regexp in PHP. The "I miss U" technique

The following regular expression matches tags that are opened and close in different lines, albeit can be used for any other purpose. It is also ungreedy, meaning that when the first closing tag is found the rest of equal tags will be ignored.

It is very easy to remember and to apply, I call it the "I MISS YOU" technique, see the why in the regexp modifiers: ...