Writings by Miguel Regedor

Is O2 Germany a good internet provider?

Is O2 Germany a good internet provider? Make the long story short, it's probably the worst german provider you can choose. Why? From personal experience I can assure you it is a big company, only w...

Swapping values order for every line with vim

I have a .json file with a few thousands of locations, this is how it looks like: ... { "name" : "Wien", "location" : [ 48.2084671, 16.3730908 ], "zip_code" : "1000" } { "name" : "Him...

Evermark

I am sure you all love Evernote and postach.io. I write my blog posts with markdown and bamm! It's automatically online, good looking, nicely formatted... at least most of the time. Nevertheless, i...

How to remove empty values from hash?

Whenever it is possible, I put code readability in front of performance (sometimes any performance gain can be crucial). Today the method Hash#delete_if came in handy: ``` ruby hash.delete_if { ...

Syntax highlighting for your evernote postach.io blog

I am really excited about using Postach.io. After using Wordpress, Github Jekyll, Tumblr and so on. I really believe that post directly from Evernote is what going to make me keep going on. However...

Symbol that is equals to any String

While writing some specs, I came in need or the following assertion: ``` my_json.should == [ { “identifier" => :ANY_STRING, "name" => “Super Name", “pos" => 3 }, { "identifi...

O empreendedor que faz empreender

A recessão económica que atacou com ferocidade os níveis de desemprego jovem no sul da Europa, à qual Portugal não ficou imune, acabam por incitar discursos motivadores que procuram abrir a cortina...

Ruby 2 is out!

Today [version 2.0.0 of Ruby has been released] (http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/). Ruby 2.0.0 is the first stable release of the Ruby 2.0 series, with many n...

Exclusivamente Software Livre nas Escolas

Neste video Miguel Regedor defende que a utilização de software livre é a opção correcta para as escolas portuguesas. Uh oh, it looks like your embed code is broken Estas são as principais razões p...

From Wordpress to GitHub and About.me with Custom Domain

Recently, I moved my writings from Worpress to GitHub. In addition, I created a profile on about.me and I wanted to have everything under the same domain (www.miguelregedor.com). The plan was to ha...

Contact Day Sonae

More than 11000 university students registered in "Rede Contacto", the social network created by Sonae (Sonae is a retail company, the largest private employer in Portugal). The aim is to start a i...

Analysing and Measuring Open Source Projects

Thousands of open source software projects are available for collaboration in platforms like Github or Sourceforge. However, there is no systematic information about the quality of those projects...

Shutdown Timer

This is a simple tip. Go to the terminal and type: sudo shutdown -h +45 After that your system will shut down in 45 minutes. You can also specify the exact time: sudo shutdown -h 22:30 If you wan...

Create XML schema from XML file

Suppose you want to create a xsd based on an "example.xml" structure. After download and extract trang you can run it with: java -jar /trang.jar example.xml example.xsd The "example.xsd" file ...

ActionMailler and Gmail (no plugins)

Last week I run into some problems while configuring the ActionMailler with Gmail. I have already some applications in production using this method. However this one, using ruby 1.8.7 and rails 2.3...

Gato Fedorento - Esmiúça os Sufrágios

Apenas uma referencia para quem me pediu os links: 1º Episódio - part1, part2, part3 (José Sócrates) 2º Episódio - part1, part2, part3 (Manuela Ferreira Leite) 3º Episódio - part1, part2, part3 (Pa...

Change default user shell

Example of how to use chsh command to change current user shell to bash: chsh -s /bin/bash

Hash to Object

Sometimes I have the need to create objects that responds to some methods with a specific values. Something that I can use like HashObject.new :method1 => value_for_method1, :method2 =&...

Git push to remote non default port

Just a note, this is the way to push the current branch to a branch on a remote git repository using ssh trough non default port: git push ssh://remote_user@domain.com:remote_port/~/remote_rep...

Object.tot

I know Rails 2.3 is out and has a new "try" method, But I was looking into an old app and I saw some code I have written. It's extending the object class with a method called tot (that or that lol...

Git clone from remote repository with ssh and non default port

Just a reminder, suppose your ssh port is 3022: (sometimes I swap the way to specify the port in those two commands) git clone ssh://user@domain.com:3022/~/Projects/my_project ssh user@domain....

Git diff pacth

How to create a patch with git diff: git diff HEAD~2 > changes.diff How to use it: patch -Np2 -i changes.diff thanks to Andy ;)

Get all values of a single column efficiently

Imagine you want this: ``` @names = MyModel.find(:all).map{ |i| i.name }.uniq ``` Yes, that works! You get all distinct names of one column, you can even do something like that: ``` #Using Sho...

Rewrite humanize

I have an application with all tables and field names in English, but the whole views now need to be in Portuguese. Because I’m always using the humanize method, a simple solutions should emerge...

Ruby on Rails no Ubuntu

As seguintes instruções demonstram como instalar o framework ruby on rails. Os comandos abaixo listados, foram por mim executadas exactamente após a instalação do Ubuntu 8.10. Não deve ser necessár...

How to Install Skype (Ubuntu)

Easy as it is. Just add the repository into your rep. list, update the package information and install Skype. Open your list: sudo vim /etc/apt/sources.list Add this line at the end: deb http://dow...

Awareness Test

Uh oh, it looks like your embed code is broken. Learn more about embedding youtube Go here http://www.dothetest.co.uk/ to see the first one and...

PayPal Payments Standard, Subscriptions and IPN with Ruby on Rails.

Hi there! I spend the last week struggling with PayPal documentations and with their buggy sandbox. The information is not well organized, and you can spend hours jumping between pages and pdf to...

E o semestre acabou

Viva! Antes de mais gostaria de pedir as mais humildes desculpas às largas centenas de pessoas que nos últimos dois meses tem visitado o meu blog na esperança de algo novo… Humm… Eu admito, não sã...

VIM for beginners

The first time I saw vi text editor was when I reached university. At the time, it seemed a little bit counterintuitive . I think it is a normal feeling to new vi users, even more, if you are, like...

Finntroll

Gosto de ouvir um pouco de todos os estilos musicais. Vou dar a conhecer um pouco daquilo que me vai aparecendo de novo! O que se segue, tem a contribuição do vorph, Finntroll uma banda finlândesa....

Paco de Lúcia em Lisboa

Disse-me, o meu amigo João, que Paco de Lúcia vem a Portugal, ao que parece é verdade. Dia 29 deste mês (Novembro) o músico de flamenco Paco de Lucía actuará, no Campo Pequeno, em Lisboa, num espec...

Hello world

Pronto é este o meu primeiro post! Não custou nada! Ainda por cima tive a sorte de ter a televisão ligada e acabado de aprender que Júlio Isidro, assim como mais 2 milhões de portugueses, já estão ...