<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Writings by Miguel Regedor</title>
  <id>http://writings.miguelregedor.com/feed.xml</id>
  <updated>2020-04-28T17:39:19.796000Z</updated>
  <link href="http://writings.miguelregedor.com/" />
  <link href="http://writings.miguelregedor.com/feed.xml" rel="self" />
  <generator>Werkzeug</generator>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Competition versus Collaboration</title>
    <id>http://writings.miguelregedor.com/post/competition-versus-collaboration</id>
    <updated>2018-11-28T12:21:58.184000Z</updated>
    <published>2018-08-27T13:24:00Z</published>
    <link href="http://writings.miguelregedor.com/post/competition-versus-collaboration" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <content type="html">&lt;div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;https://medium.com/@regedor/competition-versus-collaboration-5effa4689f16&quot;&gt;Read on Medium&lt;/a&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;We live in a competitive world. Would it be beneficial for organisations to recreate such an environment within the workplace or solely encourage a collaborative work environment?
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;I believe both are right. Companies are a bit like machines, and we must use the right tools to fix and improve them. The methodologies we use need to be adjusted to the situation, to the teams and the goals. &lt;/span&gt;&lt;span style=&quot;font-weight: bold;-en-paragraph:true;&quot;&gt;Both mindsets offer advantages to be explored.&lt;/span&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;https://cdn-images.postach.io/83c42cda-bdf6-4297-be8c-745ac70fb58b/26dc95e4-c5e4-4939-ac62-d95f734e6ed3/27659bb2-3b76-4df6-b20c-12c6974d893c.jpg&quot; /&gt;&lt;/div&gt;&lt;h4&gt;Competition is natural
&lt;/h4&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;People are naturally built for competition. We’ve been competing our whole life. In sports, in our early social life, or even at home with other family members for our favourite seat or that last cookie in the jar. At school, the teachers reward the ones who finish the task first… the examples are endless, and they show that human beings are prepared to be in a competitive environment.
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;In business culture, the competition offers a way to increase productivity. People know they need to be focused on the goal otherwise, they may become expendable. However, this has some obvious disadvantages: it increases stress, leads to potential malicious behaviour and resentment among employees.
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;In addition to this, I’ve witnessed some scenarios when this methodology is counterproductive. If the competing parties (teams or specific people) depend on each other to get the job done, success will be unlikely to happen. This is aggravated if a manager believes he leads a collaborative team, but the individuals are in fact on a competition mindset. Discussions will become rhetorical, everything becomes slower, and no one feels like having the proper conditions to do a good job. In this scenario the competition is hidden. When doing retrospectives about the problem, the cause is often attributed to lack of alignments, miss-communication and general circumstances that are not anyone’s specific fault.
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;People don’t feel an incentive to compete in a healthy way and make the best things for the organisation, but to wait for the other parties to make mistakes. Eventually, the machine stops.
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;https://cdn-images.postach.io/83c42cda-bdf6-4297-be8c-745ac70fb58b/26dc95e4-c5e4-4939-ac62-d95f734e6ed3/7090bf55-901b-479e-9683-fe543a187e06.jpg&quot; /&gt;&lt;/div&gt;&lt;h4&gt;Collaboration is essential
&lt;/h4&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;Nowadays, companies tend to have a structure that put departments in an inter-dependency situation. This is the kind of structure that calls for a culture of collaboration.
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;Teamwork is key, and several studies have shown businesses that use a more team-oriented approach get better and faster results. This culture of collaboration has many pros: less stress, employees encouraging one another, more inputs, creativity-friendly environment, harmonious workplace, etc. However, this is not a walk in the park.
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Even a collaboration methodology has its challenges, and the first one is to achieve focus without spending days in alignment meetings which may increase lazy behaviour. Employees may think that if they do not get the job done, someone else will, and that is a big con. &lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;Another issue that often raises in these type of teams is lack of clear leadership. A collaborative environment makes room for too many forces to arise. It might sound good, but often the ones that push and talk louder get their way, and it can damage an entire project. People have different styles and forms of work, that’s why it’s so hard to anticipate and plan solutions for these challenges. Eventually, the machine stops.
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;https://cdn-images.postach.io/83c42cda-bdf6-4297-be8c-745ac70fb58b/26dc95e4-c5e4-4939-ac62-d95f734e6ed3/ca913db5-02a2-4de7-b886-df92877e00ac.jpg&quot; /&gt;&lt;/div&gt;&lt;h4&gt;Make it work
&lt;/h4&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;First, you need to be clear on what you want to achieve and which approach better adjusts to the situation. Then, you need to ensure everyone’s playing the right game.
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Competition&lt;/span&gt; can be easily compared to a game. Let’s use soccer as an example. You have teams competing against each other, where everybody knows the rules and plays accordingly. Still, a referee is ensuring that if someone commits a foul, consequences are granting a fair competition. When promoting a competitive environment, make sure the rules are clear to everyone involved and remember that someone needs to be responsible for it. In practice, someone (manager, team lead, CEO) should ensure an healthy competition, and that there are no significant dependencies between the parties involved. Also, it should make sure that the proper communication channels are in place, and the competition is appealing for both parties, having everyone engaged.&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;Once it’s clear that everyone can get the job done on their own, be transparent. Inform both parties that they are competing and what the rules are. You need to be a fair judge, and keep in mind that, in the end, the organisation will benefit from the outcome. You can also state that at some point in the future they may end up working with members of the other team, discouraging any shady moves.
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Collaboration&lt;/span&gt; can also be observed from a sports point of view. On collective sports, the goal is to win as a team, not as an individual. If Cristiano Ronaldo scores a hat-trick, but his team suffers four goals, he and his team lose, therefore not achieving their goal. A collaborative environment must involve everyone over a common objective, and encourage all involved members to give their best towards that goal. It should be clear to everyone that there’s no point on running solo because there are no individual prizes: you either win or lose as a team. &lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;Ensure everyone is up to date on every related issue. Be clear on what you expect as an outcome, and encourage people to lead the way on their respective fields. Present some guidelines on how to proceed and encourage team diversity. Make regular appointments with the team to catch up with their progress, so they feel supported, and you can ensure progress.
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;The soccer example illustrates the common factors for both approaches. Either in a competitive or collaborative environment, there should always be someone in charge of making sure everything plays out as it’s supposed to. In the soccer game, the referee plays that part, not as an active player, but as someone who oversees the competition. On the collaboration part, the one overseeing it is the team coach, giving guidelines and watching from the bench as players work together to win.
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;My personal experience showed me that both methodologies can deliver incredible results and massive failures. In most companies, competition and collaboration are interlaced. As a company leader, correctly identifying the two can be challenging, now imagine how hard it is to cultivate them properly at the right time. It’s like being the referee, the coach of both teams, and the gardener that makes the field impeccable before the game even starts. It might sound like a lot, but it’s worth to watch a well-oiled machine moving.
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 1em; margin-bottom: 1em;&quot;&gt;&lt;span style=&quot;-en-paragraph:true;&quot;&gt;What are your experiences on this topics?
&lt;/span&gt;&lt;/div&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Is O2 Germany a good internet provider?</title>
    <id>http://writings.miguelregedor.com/post/is-o2-germany-a-good-internet-provider</id>
    <updated>2016-03-10T16:16:23.462000Z</updated>
    <published>2016-03-10T13:48:54Z</published>
    <link href="http://writings.miguelregedor.com/post/is-o2-germany-a-good-internet-provider" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;h2&gt;Is O2 Germany a good internet provider?&lt;/h2&gt;
&lt;p&gt;Make the long story short, it's probably the worst german provider you can choose.&lt;/p&gt;
&lt;h2&gt;Why?&lt;/h2&gt;
&lt;p&gt;From personal experience I can assure you it is a big company, only worried on making money, with 0% focus on having good products or caring about their clients.&lt;/p&gt;
&lt;p&gt;I call the way they get clients, a &quot;legal scam&quot;. They spend a lot on marketing and have a franchising schema for their shops. This means that when you go to a physical O2 shop, you air in a lair of sales guys, with the single purpose on making you sign contracts. These contracts are easy to sign but hard to rescind. They're so focused on it that the guys there don't really care if you cancel your contract latter. They earn money for every signature they get (just like a door to door sales man) and after that they have nothing to do with it. In fact, if you're having problems with the O2 service, the shop assistant can only call the same support line that you would call yourself, wait for 30 minutes and then ask for help. On the other side of the cell phone we'll find one of the possible worst support call center lines, so anything a little bit uncommon will not be solvable at all. Nevertheless O2 gets their money so why change it?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Am I sure about this? Well I'll tell you my story.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Me and my girlfriend have O2 cellphones, both on her name, in some plan they call kombivorteil 10 euros discount. We recently moved to a new apartment and needed Wifi at home. Went to a O2 local store and the guy was really confusing, trying to sell us everything after we said we just wanted internet at home and change my girlfriend's simcard plan. In the end he convinced my girlfriend to stay paying the same, but with some extra 3GB internet. In addition, he practically forced us to accept a tablet that we did not want saying it would have 1GB/month internet, recommending we should cancel it until the end of the year so we wouldn't start paying for the tablet's internet. Basically we would get 4 months of free internet and the tablet, but for that my girlfriend would have to accept a specific mobile plan...&lt;/p&gt;
&lt;p&gt;Later we realized it was all bullshit. He was in fact being confusing and lying intentionally. He was trying to force us to sign all the things he wanted, with the argument that it was necessary in order to get the promotions. Once again that was a lie because anyone can have those promotions anytime. Also, the tablet plan was not for free. In summary those guys are payed mercenaries to make you sign contracts. Don't believe that they'll take any responsibility on what happens. They don't have a way to help you, even if they wanted. They're powerless against O2.&lt;/p&gt;
&lt;p&gt;Nevertheless, everything was supposed to be fine and one month later, 8th of February, someone would come to install the internet at our home. All good until here, we received the tablet, but never received the router. Then my girlfriend got a missed call from O2 and called back. They wanted to confirm the address and confirm everything was ok for the 8th. 8th February, I missed work and stayed the whole morning waiting at home, but no one came! I called the support line and after realized there was some mistake. Maybe the guy at the store got it wrong but on their system it was written that they would come in during the afternoon between 12pm and 4pm. Ok, I called my boss and asked him if I could take the rest of the day off. Waited until 4pm but no one comes. I call the line again, and now they say they have technical problems, but that's normal for the technicians to be late and that I should wait at home until 18:30. I waited, no one appeared, called again and the technical problems persisted so I would need to call them the next day.&lt;/p&gt;
&lt;p&gt;We called the next day and heard amazing news! There never suppose for a technician to come because they had tried to contact us regarding a problem with our address 2 weeks ago and we didn't answer. This way they could't send the router neither the technician. The funniest part here is that when I called the day before no one told me about this. I was told 3 times to stay at home and I missed my work because of that. This person on the phone now says we need a new appointment so we can receive a email the next day with the details and get a technician to come finish the installation in the next 10 days. To compensate for the inconvenience they'll send us a simcard with 1GB internet. Remember when I said they lie? Once again, they said they would make a compensation and they never did... I don't really need another 1GB internet simcard, but why lie? Nevertheless, we assumed there was a lot of confusion but expected things to get better. Again, we never got any call or email...&lt;/p&gt;
&lt;p&gt;We contact them by phone and now they say that &lt;em&gt;I cannot have internet at home on that address&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Then I decided to do an experiment, I called again:&lt;/p&gt;
&lt;p&gt;They say &lt;em&gt;there are technical problems and they can't do anything today&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I call again: they say that &lt;em&gt;I can have internet and that everything should be ok&lt;/em&gt;. The problem was on the telecom technicians.&lt;/p&gt;
&lt;p&gt;I call again: they say that &lt;em&gt;I cannot have fiber optic but that i can have a slower internet&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Crazy how inconsistent their support line is.&lt;/p&gt;
&lt;p&gt;Still, the last person sounded reliable so I went for the slow internet option, and again they told me someone would come on a certain date. A little mad about all this I twitted something like &quot;O2 service is the worst ever&quot;, and this is the first time they take the initiative of asking talking to me by their initiative. On twitter they ask me to speak on private message. I explain the problem and now they say that my O2 account is blocked and that they need an identity check. After I share this story with them they stopped replying. I went to the shop where I went in the first place. By the way, pretty much no one on this company in Germany is capable of speaking english, even at the shop. Luckily my girlfriend can speak perfect german but when I tried to call the call center, and after waiting 40 minutes on the line, started by asking &quot;do you speak enligh?&quot; and the person on the other side said &quot;No, no, no&quot; and turned off the phone. So I think I need to add the unpolitest trouphew for O2 too.&lt;/p&gt;
&lt;p&gt;We spent 5 hours at the shop. The guys there were hopeless. Like I said, all they know is to make you sign papers. They admitted they couldn't help us that much. In the end we sent the ID by fax and my account was unblocked. They made another contract, This time I don't even got the 100 euros discount they were &quot;supposedly&quot; giving me, but instead we would get a free month of internet for the inconvenience... I would need to wait their contact to have a date for the internet. With no surprises, no contact happened so we called back. They told us to wait. I called for 3 weeks and they told us to wait again. Now they said again that apparently I cannot have internet fiber optic there because the guys from telecom don't find something... I'm not even sure why were they trying the finer again... The only thing I can do now is probably cancel the contract. I spent a lot of internet on O2 phones in the 3 month I didn't have internet at home (my building has 8 floors, 8 apartments per floor, in Munich city center and pretty much every apart has internet).&lt;/p&gt;
&lt;p&gt;If you choose O2, the only people you can talk face to face are mercenaries who want to take your money. They'll tell you lies regardless your concerns or even O2's reputation. The support line is useless and 70% of the calls end with their system not working so you'll have to call the next day. O2 mobile service coverage is very bad also.&lt;/p&gt;
&lt;p&gt;Advice from first hand experience:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;If you are choosing O2 you falling into a scam. Do yourself a favor and choose any service but O2's.&lt;/em&gt;&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Swapping values order for every line with vim</title>
    <id>http://writings.miguelregedor.com/post/swapping-values-order-for-every-line-with-vim</id>
    <updated>2018-10-25T00:28:29.546000Z</updated>
    <published>2015-03-14T17:44:00Z</published>
    <link href="http://writings.miguelregedor.com/post/swapping-values-order-for-every-line-with-vim" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;I have a .json file with a few thousands of locations, this is how it looks like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{ &quot;name&quot; : &quot;Wien&quot;, &quot;location&quot; : [ 48.2084671, 16.3730908 ], &quot;zip_code&quot; : &quot;1000&quot; }

{ &quot;name&quot; : &quot;Himberg&quot;, &quot;location&quot; : [ 48.0809480921242, 16.4446190577947 ], &quot;zip_code&quot; : &quot;2325&quot; }

...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After generating that file, I just realised that MongoDB standard for geo coordinates is &lt;strong&gt;[longitude, latitude]&lt;/strong&gt; but instead, in my file, I have &lt;strong&gt;[latitude, longitude]&lt;/strong&gt;, which means that I have to swap all this values. It is a file with 50k lines! I could probably quickly write a ruby script for that, but I am using a XXI century editor called Vim.&lt;/p&gt;
&lt;p&gt;So how to achieve this inside of Vim. A substitution: find the two values and then replace with them swapped.&lt;/p&gt;
&lt;p&gt;Best approach is to start by finding the exact targeted values. Because of the simplicity of this file, per line there is just one place where two numbers are separated by a comma and a space, our task is easy.&lt;/p&gt;
&lt;p&gt;A regular expression to match this values can be something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/[0-9.]+, [0-9.]+/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then we just need to save the values using &lt;strong&gt;( )&lt;/strong&gt; for use during the substitution.&lt;/p&gt;
&lt;p&gt;Everything inside will be after available in &lt;strong&gt;\1&lt;/strong&gt;, &lt;strong&gt;\2&lt;/strong&gt;, &lt;strong&gt;\3&lt;/strong&gt; and so on, for each pair of parenthesis from left to right.&lt;/p&gt;
&lt;p&gt;In the end, and after adding the proper escaping, this is the magical line to globally swap the values  in your file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:%s/\([0-9.]\+\), \([0-9.]\+\)/\2, \1/g
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My file now looks like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{ &quot;name&quot; : &quot;Wien&quot;, &quot;location&quot; : [ 16.3730908, 48.2084671 ], &quot;zip_code&quot; : &quot;1000&quot; }

{ &quot;name&quot; : &quot;Himberg&quot;, &quot;location&quot; : [ 16.4446190577947, 48.0809480921242 ], &quot;zip_code&quot; : &quot;2325&quot; }

...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For more vim substitutions patters go &lt;a href=&quot;http://rayninfo.co.uk/vimtips.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I so glad that I move back to vim.&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Evermark</title>
    <id>http://writings.miguelregedor.com/post/evermark</id>
    <updated>2018-10-25T00:30:28.557000Z</updated>
    <published>2014-09-24T21:41:43Z</published>
    <link href="http://writings.miguelregedor.com/post/evermark" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;I am sure you all love &lt;a href=&quot;https://evernote.com/&quot;&gt;Evernote&lt;/a&gt; and &lt;a href=&quot;http://postach.io/&quot;&gt;postach.io&lt;/a&gt;. I write my blog posts with &lt;a href=&quot;https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet&quot;&gt;markdown&lt;/a&gt; and bamm! It's automatically online, good looking, nicely formatted... at least most of the time. Nevertheless, it would be great to see the markdown result before putting a post online. There are a few web sites for parsing markdown but I would rather prefer something side by side with Evernote showing me the result and obviously that could be run offline.&lt;/p&gt;
&lt;h2&gt;Marked2, Evernote and Everwatch&lt;/h2&gt;
&lt;p&gt;My first try was &lt;a href=&quot;http://marked2app.com/&quot;&gt;Marked2&lt;/a&gt;, although it does not integrate by default with Evernote, let's say that Evernote is not simply a text file editor, it saves the notes on its own way, but Marked basically watches for changes in a file, and I don't know where my &quot;note file&quot; is.&lt;/p&gt;
&lt;p&gt;However it is not that hard to get this duo to work, &lt;a href=&quot;http://brettterpstra.com/2011/11/14/marked-scripts-nvalt-evernote-marsedit-scrivener/&quot;&gt;Brett Terpstra&lt;/a&gt; worked out a few scripts to help with this and other Evernote integrations, for this case &lt;strong&gt;everwatch&lt;/strong&gt; is the script we need. Therefor I had the need to do a few updates to this ruby script to make it work with the latest version of marked (Marked2) and Evernote.&lt;/p&gt;
&lt;p&gt;The updated &lt;a href=&quot;https://github.com/regedor/everwatch&quot;&gt;everwatch ruby script&lt;/a&gt; is what you need if you want to preview you Evernote markdown notes using Marked2.&lt;/p&gt;
&lt;p&gt;Note: Marked2 is perfect apart from the fact that it is payed, sure you can check the trial version and if you like it, it´s worth the money.&lt;/p&gt;
&lt;h2&gt;Evermark (Evernote Markdown Preview)&lt;/h2&gt;
&lt;p&gt;Maybe because I did not want to buy Marked2 (maybe open source self conflict issues) I decided to create Evermark.&lt;/p&gt;
&lt;p&gt;Evermark is a simple App that you can connect to Evernote through applescript and that shows you the parsed markdown html with a nice code highlight and CSS on the browser of you choice. As you do changes on Evernote the page is refreshed in few seconds.&lt;/p&gt;
&lt;p&gt;The app has few dependencies but you need to have xcode intalled on your mac. If you don't have it though, you should open a terminal before using Evermark and type:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
xcode-select --install

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The app is available for free and the source code is on GitHub&lt;/p&gt;
&lt;p&gt;it was heavily inspirited by &lt;a href=&quot;https://github.com/regedor/everwatch&quot;&gt;everwatch&lt;/a&gt; and &lt;a href=&quot;https://gist.github.com/thykka/9727654&quot;&gt;live.js&lt;/a&gt;, since it was coded in ruby I  used platypus to wrap it into a OSX app.&lt;/p&gt;
&lt;p&gt;Almost forgot... the &lt;strong&gt;&lt;a href=&quot;https://github.com/regedor/evermark/archive/v0.3.zip&quot;&gt;download link&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;And the &lt;a href=&quot;https://github.com/regedor/Evermark/&quot;&gt;source code&lt;/a&gt; too!&lt;/p&gt;
&lt;h2&gt;Installation and Usage Video&lt;/h2&gt;
&lt;p&gt;&lt;div class=&quot;responsive-embed embed-16by9&quot;&gt;&lt;iframe width=&quot;640&quot; height=&quot;360&quot; src=&quot;https://www.youtube.com/embed/fPcf4m2q0vM?feature=oembed&quot; frameborder=&quot;0&quot; allow=&quot;autoplay; encrypted-media&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h2&gt;The Evermark Jingle&lt;/h2&gt;
&lt;p&gt;I had so much fun doing it that I even made a Jingle:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;responsive-embed embed-4by3&quot;&gt;&lt;iframe width=&quot;100%&quot; height=&quot;400&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; src=&quot;https://w.soundcloud.com/player/?visual=true&amp;url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F168195520&amp;show_artwork=true&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Git WIP Commit</title>
    <id>http://writings.miguelregedor.com/post/git-wip-commit</id>
    <updated>2018-10-25T00:31:36.009000Z</updated>
    <published>2014-04-07T12:02:20Z</published>
    <link href="http://writings.miguelregedor.com/post/git-wip-commit" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;Git has a nice stash command, but often I find it simpler to just commit the current changes on the branch I working on.&lt;br /&gt;
Later come back to the branch and undo the &quot;WIP&quot; commit (assuming I did not push it to more people).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git commit -a -m &quot;WIP&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Later when coming back to the branch:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git reset --soft HEAD^
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now I can keep working on it and then:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git commit -c HEAD@{1}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The -c will bring the old log message.&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">How to remove empty values from hash?</title>
    <id>http://writings.miguelregedor.com/post/how-to-remove-empty-values-from-hash</id>
    <updated>2020-04-28T17:39:05.307000Z</updated>
    <published>2014-03-31T17:55:00Z</published>
    <link href="http://writings.miguelregedor.com/post/how-to-remove-empty-values-from-hash" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;Whenever it is possible, I put code readability in front of performance (sometimes any performance gain can be crucial).&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Today the method Hash#delete_if came in handy:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;``` ruby&lt;/div&gt;
&lt;div&gt;hash.delete_if { |k, v| v.nil? }&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;That line will delete all elements which value is ```nil```. You can also achieve a recursive solution with the following code:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;``` ruby&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;hash.delete_if{|k, v| v.nil? or v.instance_of?(Hash) &amp;&amp; v.delete_blank.nil?}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;But how did it helped me today?&lt;/div&gt;
&lt;div&gt;That was my efficient code:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;``` ruby&lt;/div&gt;
&lt;div&gt;if father&lt;/div&gt;
&lt;div&gt;  if mother&lt;/div&gt;
&lt;div&gt;    { dad: father.name, mom: mother.name}&lt;/div&gt;
&lt;div&gt;  else&lt;/div&gt;
&lt;div&gt;    { dad: father.name, mom: mother.name}&lt;/div&gt;
&lt;div&gt;  end&lt;/div&gt;
&lt;div&gt;else&lt;/div&gt;
&lt;div&gt;  {}&lt;/div&gt;
&lt;div&gt;end&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;And now the same behaviour, less efficient, but at my eyes much more readable, expressive, and easy to reuse:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;``` ruby&lt;/div&gt;
&lt;div&gt;{ dad: father &amp;&amp; father.name, mom: mother &amp;&amp; mother.name}.delete_if { |k, v| v.empty? }&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Syntax highlighting for your evernote postach.io blog</title>
    <id>http://writings.miguelregedor.com/post/syntax-highlighting-for-your-evernote-postach-io-blog</id>
    <updated>2018-10-25T00:31:36.622000Z</updated>
    <published>2014-03-20T16:27:00Z</published>
    <link href="http://writings.miguelregedor.com/post/syntax-highlighting-for-your-evernote-postach-io-blog" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;I am really excited about using &lt;a href=&quot;http://postach.io/&quot;&gt;Postach.io&lt;/a&gt;. After using Wordpress, Github Jekyll, Tumblr and so on.&lt;/p&gt;
&lt;p&gt;I really believe that post directly from Evernote is what going to make me keep going on.&lt;/p&gt;
&lt;p&gt;However to get &lt;a href=&quot;http://gorgeouscode.com/&quot;&gt;Gorgeous Code&lt;/a&gt; going on, I need code highlighting.&lt;/p&gt;
&lt;p&gt;It is as simple as inserting the code below in your head.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
?

link rel=&amp;quot;stylesheet&amp;quot; title=&amp;quot;Tomorrow Night&amp;quot; href=&amp;quot;http://highlightjs.org/static/styles/tomorrow-night.css&amp;quot;&amp;gt;

?

script src=&amp;quot;http://highlightjs.org/static/highlight.pack.js&quot;&amp;gt;?/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And also the following code at the end of the body.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
?

script&amp;gt;

//Syntax Highlighter

hljs.configure({tabReplace: '  '});

hljs.initHighlightingOnLoad();

?

/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After that if your using markdown you just need to surround your code with 3 back-quotes ```.&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Symbol that is equals to any String</title>
    <id>http://writings.miguelregedor.com/post/symbol-that-is-equals-to-any-string</id>
    <updated>2020-04-28T17:39:18.952000Z</updated>
    <published>2014-03-14T14:12:12Z</published>
    <link href="http://writings.miguelregedor.com/post/symbol-that-is-equals-to-any-string" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;While writing some specs, I came in need or the following assertion:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;my_json.should == [&lt;/div&gt;
&lt;div&gt;  {
&lt;div&gt;    &quot;identifier&quot; =&gt; :ANY_STRING,&lt;/div&gt;
&lt;div&gt;    &quot;name&quot; =&gt; &quot;Super Name&quot;,&lt;/div&gt;
&lt;div&gt;    &quot;pos&quot; =&gt; 3 &lt;/div&gt;
&lt;div&gt;  },&lt;/div&gt;
&lt;div&gt;  {&lt;/div&gt;
&lt;div&gt;    &quot;identifier&quot; =&gt; :ANY_STRING&lt;/div&gt;
&lt;div&gt;    &quot;name&quot; =&gt; &quot;&lt;a href=&quot;http://provider_2.name&quot;&gt;S&lt;/a&gt;uper Name&quot;,&lt;/div&gt;
&lt;div&gt;    &quot;pos&quot; =&gt; 2,&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;  }&lt;/div&gt;
&lt;div&gt;]&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Yes, I want to match regardless of the string contained in the identifier. Obviously I could removed this key from the hashes and do the match.&lt;/div&gt;
&lt;div&gt;But wouldn’t it be sweet if that symbol would match any string?&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Since we are using ruby it is quite easy to overwrite the built in methods:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;class String&lt;/div&gt;
&lt;div&gt;  def ==(string)&lt;/div&gt;
&lt;div&gt;    return true if string.is_a?(Symbol) &amp;&amp; string == :ANY_STRING&lt;/div&gt;
&lt;div&gt;    super(string)&lt;/div&gt;
&lt;div&gt;  end&lt;/div&gt;
&lt;div&gt;end&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;I would not consider this kind of monkey patch a good practice, however...&lt;/div&gt;
One of the things I love about ruby is the fact that it let’s you do crazy stuff.
&lt;div&gt;In addition, one of the things I don’t love about ruby is the fact that it let’s you make crazy stuff. &lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Like the Spider Man knows well, with great power comes great responsibility.&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">O empreendedor que faz empreender</title>
    <id>http://writings.miguelregedor.com/post/o-empreendedor-que-faz-empreender</id>
    <updated>2015-03-05T08:16:11.370000Z</updated>
    <published>2013-05-31T14:45:00Z</published>
    <link href="http://writings.miguelregedor.com/post/o-empreendedor-que-faz-empreender" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;p&gt;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 de desespero através de perspetivas alternativas, muitas vezes baseadas em formas de pensar o emprego ou o lucro de uma maneira menos convencional. A procura de soluções criativas quando os modelos vigentes não funcionam é natural.&lt;/p&gt;
&lt;p&gt;O que acontece quando o cenário social não parece seguir as pegadas que seguiram as gerações anteriores, o resultado é uma geração perdida. O mundo como o conhecíamos até agora parece não estar a funcionar. Subitamente somos engenheiros de um sistema que não compreendemos completamente, médicos à procura de uma cura que nunca ninguém nos ensinou a curar porque nem sequer sabíamos que existia.&lt;/p&gt;
&lt;p&gt;É quando surgem aquilo que designarei por &quot;gurus do pensamento positivo&quot;.  Nada de errado em promover ideias inspiradoras e motivacionais. Aliás, é certo que a confiança e o pensamento positivo são fatores de extrema relevância quando se tem ambições e se quer criar algo mesmo que essa criação implique dificuldades. A crença em nós mesmos e nas nossas ideias é o que nos permite psicologicamente persistir perante os mais diversos obstáculos.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://cdn-images.postach.io/6fbf4e3b8884b752b60630732a5dd53b/309dcc445e2da5ea2b2811eed6e2d204/w600_80de169764df959e0f48d3320683e20b.png&quot;&gt;&lt;img src=&quot;https://cdn-images.postach.io/6fbf4e3b8884b752b60630732a5dd53b/309dcc445e2da5ea2b2811eed6e2d204/w600_80de169764df959e0f48d3320683e20b.png&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Não obstante, pode dizer-se que o trabalho de fazer os outros trabalharem parece cair num ciclo vicioso sem finalidade aparente. Os profissionais da motivação que nos ensinam a sermos otimistas em relação ao nosso futuro profissional tornaram-se... profissionais de nos fazer acreditar no futuro profissional. Soa confuso. Parece que o empreendorismo está na moda e nenhuma moda faz bem a ninguém. Quando dizemos que algo está na moda queremos dizer que é aquilo que toda a gente faz, na maior parte dos casos por imitação e sem grande consciência.&lt;br /&gt;
Se queremos ser diferentes ao modelo vigente para encontrar alternativas, temos então que fugir da moda.&lt;br /&gt;
Enquanto o empreendedorismo estiver na moda, parece-me que a verdadeira forma de o ser é ficar quietinho no quarto ou no emprego e plantar uns vegetais na varanda (para quem se quiser aventurar no mundo da plantação: aconselho que comecem com tomates, é preciso perder um tempinho a regar os pequenos mas não me faltou salada este verão. É um fruto excelente para plantar em varandas, sim porque tomate é fruto, não é vegetal).&lt;br /&gt;
Pensem nisto: Quando todos tiverem a sua start up, empreendedor vai ser o gajo que não tem start up!&lt;br /&gt;
O que significa que aquele gajo que está neste momento a comer pipocas enquanto assiste um filme depois do trabalho é um visionário que está astutamente à espera do seu momento de gloria!&lt;/p&gt;
&lt;p&gt;Mas em grande parte, e como tudo que é moda parece que funciona como um esquema em pirâmide.&lt;br /&gt;
&quot;Ora bem eu agora... que sei muito de empreendedorismos vou fazer uma start up de dar palestras para ensinar empreendedorismo, a quem? a pessoas que possivelmente vão ser bem sucedidas novamente divulgando o empreendedorismo..&quot;&lt;/p&gt;
&lt;p&gt;Com um ou outro formato, as talks sobre empreendedorismo são sempre o mesmo.&lt;br /&gt;
Ouvir a primeira é útil, se não tiverem boa memória vale a pena ouvir uma segunda, para cimentar a matéria.&lt;/p&gt;
&lt;p&gt;Depois há aquela coisa irritante do sujeito que é empreendedor quando fala parece que nos vem esfregar na cara que nós estamos onde estamos por não sermos empreendedores o suficiente quando ele na realidade teve a brilhante ideia de empreender dizendo aos outros como se empreende. Quantas empresas de sucesso tens tu, afinal, caro colega?&lt;/p&gt;
&lt;p&gt;Esta onda ultra-motivacional parece às vezes cair no ridículo. Empresas que tentam expandir o seu negócio com o modelo yves rocher com o apadrinhamento do Donald Trump, dizem que vendem produtos mas que se ganha mais mesmo é quando se angariam mais pessoas que a custo zero possam vender mais produtos. Há aqui uma forma neo-liberal de lidar com a situação que conduz as pessoas a acreditar em lamborghinis alugados em frente aos hotéis de 5 estrelas onde o evento decorre e o dress-code é exigente porque há uma ideia de riqueza e classe alta a transmitir a um monte de gente que não vai estar a ganhar por ano, aquilo que ganha por mês uma gaspeadeira.&lt;/p&gt;
&lt;p&gt;E depois vem alguém e diz: &quot;Esquema de pirâmide, mas qual esquema de pirâmide? E vendo bem isto da esquema de pirâmide até não tem nada de mal...&quot;.&lt;/p&gt;
&lt;p&gt;Ser empreendedor não significa que precisemos nem de andar pelo país a dar palestras demonstrando que o nosso trabalho é dizer aos outros para irem trabalhar, nem pertencer a esquemas de pirâmide que nos dão uma ilusão de sermos muito ricos quando é uma profunda ilusão nociva para mentes mais desprevenidas e sem o meu sentido de cinismo.&lt;/p&gt;
&lt;p&gt;Por exemplo, quando tive o meu primeiro computador tinha dez anos, uma vizinha amiga tinha uma impressora, que me deixava usar, um amigo da família  pintor surrealista, ia fazer uma exposição. Na minha loucura disse-lhe &quot;Eu tenho uma empresa que criei com uns vizinhos de nome Saturano, fazemos-te os cartazes a um preço mais barato que a gráfica . O homem ainda devia ser mais maluco do que eu para aceitar como valida esta proposta, vinda de um puto com 10 anos e 27 quilos. Basicamente, depois de algumas peripécias para arranjar um scanner e forma de imprimir folhas A3 numa impressora A4 (não posso revelar o segredo, é factor diferenciador deste negocio, lol). Lá estava o primeiro trabalho da Saturano, empresa caseira, com um belo logótipo carinhosamente criado no MS Paint.&lt;/p&gt;
&lt;p&gt;Isto é um exemplo de empreendedorismo. Não passa por talks, não passa por prometer a ninguém o paraíso. É simplesmente a criatividade e dinamismo aplicados a uma forma de produção inteligente que reduz custos e se torna competitiva.&lt;/p&gt;
&lt;p&gt;Resumindo, não gosto de ser pessimista, mas se querem fazer alguma coisa simplesmente façam, tentem, analisem resultados. Dificilmente se vão tornar no Donald Trump mais certamente vão conseguir comprar um Iphone.&lt;/p&gt;
&lt;p&gt;Neste momento vou arrancar com um projecto novo que é: apagar luz, deitar-me no quentinho e esperar que o senhor sono chegue. Boa noite, e novamente, tentem sempre encontrar um lado positivo nestas coisas todas.&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Ruby 2 is out!</title>
    <id>http://writings.miguelregedor.com/post/ruby-2-is-out</id>
    <updated>2020-04-28T17:39:19.796000Z</updated>
    <published>2013-02-24T17:28:00Z</published>
    <link href="http://writings.miguelregedor.com/post/ruby-2-is-out" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;Today [version 2.0.0 of Ruby has been released] (&lt;a href=&quot;http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/&quot;&gt;http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/&lt;/a&gt;).&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Ruby 2.0.0 is the first stable release of the Ruby 2.0 series, with many new features and improvements in response to the increasingly diverse and expanding demands for Ruby.&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Read more about the [new core language features] (&lt;a href=&quot;http://blog.marc-andre.ca/2013/02/23/ruby-2-by-example/&quot;&gt;http://blog.marc-andre.ca/2013/02/23/ruby-2-by-example/&lt;/a&gt;).&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Exclusivamente Software Livre nas Escolas</title>
    <id>http://writings.miguelregedor.com/post/exclusivamente-software-livre-nas-escolas</id>
    <updated>2015-03-05T08:16:11.427000Z</updated>
    <published>2013-02-15T22:08:00Z</published>
    <link href="http://writings.miguelregedor.com/post/exclusivamente-software-livre-nas-escolas" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;p&gt;Neste video Miguel Regedor defende que a utilização de software livre é a opção correcta para as escolas portuguesas.&lt;/p&gt;
&lt;p&gt;Uh oh, it looks like your embed code is broken&lt;/p&gt;
&lt;p&gt;Estas são as principais razões pelas quais as escolas do nosso país devem usar exclusivamente Software Livre:&lt;/p&gt;
&lt;h2&gt;Partilha&lt;/h2&gt;
&lt;p&gt;As escolas devem ensinar o valor da partilha dando o exemplo. O Software Livre apoia a educação, permitindo a partilha de conhecimento e ferramentas.&lt;/p&gt;
&lt;p&gt;Com o Software Livre, a partilha dos programas não é apenas autorizada, é encorajada.&lt;/p&gt;
&lt;h2&gt;Responsabilidade Social&lt;/h2&gt;
&lt;p&gt;A informática tornou-se parte essencial da vida quotidiana. A tecnologia continua a transformar a sociedade muito rapidamente.&lt;/p&gt;
&lt;p&gt;Os alunos tem de ser preparados para participar numa sociedade digital, por isso as escolas devem dar-lhes as competências para que estes possam controlar as suas próprias vidas.&lt;/p&gt;
&lt;p&gt;O software não deve estar sob o poder de uma única empresa que toma decisões unilateralmente e que ninguém pode mudar. As escolas não devem permitir que empresas de software proprietário possam impor o seu poder sobre a sociedade e o seu futuro.&lt;/p&gt;
&lt;h2&gt;Independência&lt;/h2&gt;
&lt;p&gt;As escolas têm a responsabilidade ética de ensinar, não de criar dependência de um único produto ou de uma empresa específica.&lt;/p&gt;
&lt;p&gt;Ao utilizar Software Livre, a escola ganha independência de interesses comerciais.&lt;/p&gt;
&lt;h2&gt;Aprendizagem&lt;/h2&gt;
&lt;p&gt;Para estudantes realmente interessados pela área da Informatica. O Software Livre significa que os alunos são livres para estudar como os programas funcionam e aprender a adaptá-los para suas próprias necessidades.&lt;/p&gt;
&lt;p&gt;Aprender sobre Software Livre também ajuda a estudar a ética de desenvolvimento de software e a prática profissional.&lt;/p&gt;
&lt;h2&gt;Economica&lt;/h2&gt;
&lt;p&gt;Esta é uma vantagem óbvia que vai chamar a atenção de muitos administradores escolares.  Devido à possibilidade de distribuição dos programas sem qualquer custo, as escolas podem realmente ajudar as famílias que enfrentam problemas financeiros, promovendo a equidade e a igualdade de oportunidades de aprendizagem entre os estudantes.&lt;/p&gt;
&lt;h2&gt;Qualidade&lt;/h2&gt;
&lt;p&gt;Estável, seguro e fácil de instalar. A excelência do desempenho é um benefício secundário, o objetivo final é a liberdade dos utilizadores.&lt;/p&gt;
&lt;h2&gt;Um programa de software  é Livre quando o seu utilizador tem quatro liberdades essenciais:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Liberdade 0&lt;/strong&gt; é a liberdade de executar o programa.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Liberdade 1&lt;/strong&gt; é a liberdade de estudar o código fonte do programa e de o alterar.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Liberdade 2&lt;/strong&gt; é a liberdade para ajudar o seu próximo, ou seja, liberdade para fazer e distribuir cópias do programa em qualquer momento.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Liberdade 3&lt;/strong&gt; é a liberdade de contribuir para sua comunidade, isto é, a liberdade de fazer e distribuir cópias das suas versões modificadas do programa.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Referencia: http://www.gnu.org/&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">From Wordpress to GitHub and About.me with Custom Domain</title>
    <id>http://writings.miguelregedor.com/post/from-wordpress-to-github-and-about-me-with-custom-domain</id>
    <updated>2015-03-05T08:16:11.439000Z</updated>
    <published>2011-06-15T20:51:00Z</published>
    <link href="http://writings.miguelregedor.com/post/from-wordpress-to-github-and-about-me-with-custom-domain" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;Recently, I moved my writings from Worpress to GitHub.&lt;/p&gt;
&lt;p&gt;In addition, I created a profile on about.me and I wanted to have everything under the same domain (www.miguelregedor.com).&lt;/p&gt;
&lt;p&gt;The plan was to have the about.me profile as the landing page,&lt;br /&gt;
but about.me does not provide a custom domain service.&lt;br /&gt;
In fact, they were planing to add it.&lt;br /&gt;
Although, because they were acquired by AOL, it isn't sure if that is going to happen anytime soon.&lt;/p&gt;
&lt;p&gt;I could have used a rewrite rule in the htaccess, but either get the redirect without the URL or get the URL with broken links.&lt;br /&gt;
Furthermore, I wanted to have the blog posts under the same domain, so this would never work.&lt;/p&gt;
&lt;p&gt;My solution was to host the blog in GitHub&lt;br /&gt;
(All GitHub accounts include web hosting and you can add custom domains to it.)&lt;br /&gt;
and use the old style framesets to embed the about.me profile,&lt;br /&gt;
the only issue with this solution is that it will mess the about.me link source statistics,&lt;br /&gt;
obvious the source link will always be your own web site.&lt;/p&gt;
&lt;p&gt;Lots of people asked how I did.&lt;br /&gt;
Next, I'll explain the whole process (you should consider www.regedor.com as an example, replace it with your domain):&lt;/p&gt;
&lt;h2&gt;Embeding about.me&lt;/h2&gt;
&lt;p&gt;After creating the repository, in my case regedor.github.com.&lt;br /&gt;
Create an index.html file like the one bellow. This is the magic for embedding about.me or any other site into any webpage under any domain.&lt;br /&gt;
However, when you're using frames with pages not from the same domain, you will have some limitation, that happens for security reasons.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Frameset//EN&amp;quot;
  &amp;quot;http://www.w3.org/TR/html4/frameset.dtd&amp;quot;&amp;gt;



  Personal Web Site






&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then, create a file called CNAME containing your domain, so that GitHub will accept the custom domain, this can be done in the shell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    echo &amp;quot;www.regedor.com&amp;quot; &amp;gt; CNAME
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You need to add the CNAME record to your DNS (it should redirect www.regedor.com to regedor.github.com).           &lt;/p&gt;
&lt;h2&gt;Exporting posts from wordpress:&lt;/h2&gt;
&lt;p&gt;The first step is to download the xml file containing the posts (replace miguelregedor with your wordpress username):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://miguelregedor.wordpress.com/wp-admin/export.php
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;At this point I tried to use Jekyll::WordpressDotCom to create the posts.&lt;br /&gt;
However, it was a litle bit buggy at the time.&lt;br /&gt;
I created a script (based on Jekyll code). After downloading the script,&lt;br /&gt;
&lt;a href=&quot;https://raw.github.com/regedor/regedor.github.com/master/assets/wordpress_xml.rb&quot;&gt;here&lt;/a&gt;,&lt;br /&gt;
you can use it to generate the posts with something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ ruby -r 'wordpress_xml.rb' -e 'WordpressXML.to_posts(&amp;quot;wordpress.xml&quot;)'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now you have a folder with all your posts.&lt;br /&gt;
You just need to add a file that will list the posts:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
      Writings

        { % for post in site.posts %}

          { { post.title }},
          { { post.date | date_to_long_string }}

        { % endfor %}


&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To have a better understanding of how to organize your files, you can look at my repository.&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Contact Day Sonae</title>
    <id>http://writings.miguelregedor.com/post/contact-day-sonae</id>
    <updated>2018-10-25T00:37:59.558000Z</updated>
    <published>2011-03-11T20:54:00Z</published>
    <link href="http://writings.miguelregedor.com/post/contact-day-sonae" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;More than 11000 university students registered in &quot;Rede Contacto&quot;, the social network created by Sonae (Sonae is a retail company, the largest private employer in Portugal). The aim is to start a innovative recruitment process of young graduates with high potential. For months, students are challenged to perform various tasks (online quizzes, questionnaires, etc). That allows the participants to accumulate points that grant access to Dia Contacto (Contact Day).&lt;/p&gt;
&lt;p&gt;I was one of the lucky 60 selected students. I was invited to spend a full day getting to know Sonae. I accepted the invitation. What can I say now? It made me have a very positive image of Sonae.&lt;/p&gt;
&lt;p&gt;In the morning, they showed us the facilities, the whole team was friendly, and everything seemed well organized. They even provided a free lunch (It was good, not too posh, a quick stand-up buffet). After lunch, we listen to the top officers (Eng. Belmiro, Eng. Paul, Dr. Luís Reis). I really liked their proximity and the stories told. Furthermore, I compliment the emphasis given to the company's values, although the talk about it was a bit too long. In my opinion, there is no need to write values on walls. Values are defined through the committed actions.&lt;/p&gt;
&lt;p&gt;Also during the afternoon, the students formed teams and played games. The performances of students were being assessed throughout all day. The challenges seemed too simple, for masters degree students with some professional experience. I believe that this day was primarily designed for post-bolonha graduates, a student can now finish a degree with only 19 years, sometimes maturity may call into question. The main element of assessment was the willingness  to be part of Sonae. Anyway, it was an inspiring day for people desirous to start a professional career.&lt;/p&gt;
&lt;p&gt;Overall, it was a nice experience. Sonae +1&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Analysing and Measuring Open Source Projects</title>
    <id>http://writings.miguelregedor.com/post/analysing-and-measuring-open-source-projects</id>
    <updated>2020-04-28T17:39:13.087000Z</updated>
    <published>2011-02-10T12:45:00Z</published>
    <link href="http://writings.miguelregedor.com/post/analysing-and-measuring-open-source-projects" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
Thousands of open source software projects are available for collaboration in platforms like Github or Sourceforge.
&lt;/div&gt;
&lt;div&gt;However, there is no systematic information about the quality of those projects.&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Few users have the ability to assess the quality of a project by looking at source code.&lt;/div&gt;
&lt;div&gt;With that in mind, a system capable of automatically analysing and producing reports about a given Open Source Sofware Project would enable users to make better choices,&lt;/div&gt;
&lt;div&gt;and developers to further improve their software.&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Furthermore, I am, currently, writing my master thesis and will engage myself to create an application capable of automatic analyse and measure GitHub public projects.&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Shutdown Timer</title>
    <id>http://writings.miguelregedor.com/post/shutdown-timer</id>
    <updated>2020-04-28T17:39:19.707000Z</updated>
    <published>2010-06-12T23:28:00Z</published>
    <link href="http://writings.miguelregedor.com/post/shutdown-timer" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
&lt;p style=&quot;padding: 0px; line-height: 21.600000381469727px; color: rgb(68, 68, 68); font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(255, 255, 255);&quot;&gt;This is a simple tip. Go to the terminal and type:&lt;/p&gt;
&lt;p style=&quot;padding: 0px; line-height: 21.600000381469727px; color: rgb(68, 68, 68); font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(255, 255, 255);&quot;&gt;&lt;code style=&quot;padding: 0px; line-height: normal; font-size: 1.1em; font-family: 'Courier New', Courier, monospace;&quot;&gt;sudo shutdown -h +45&lt;/code&gt;&lt;/p&gt;
&lt;p style=&quot;padding: 0px; line-height: 21.600000381469727px; color: rgb(68, 68, 68); font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(255, 255, 255);&quot;&gt;After that your system will shut down in 45 minutes.&lt;br style=&quot;padding: 0px; line-height: inherit;&quot;/&gt;
&lt;br/&gt;
You can also specify the exact time:&lt;/p&gt;
&lt;p style=&quot;padding: 0px; line-height: 21.600000381469727px; color: rgb(68, 68, 68); font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(255, 255, 255);&quot;&gt;&lt;code style=&quot;padding: 0px; line-height: normal; font-size: 1.1em; font-family: 'Courier New', Courier, monospace;&quot;&gt;sudo shutdown -h 22:30&lt;/code&gt;&lt;/p&gt;
&lt;p style=&quot;padding: 0px; line-height: 21.600000381469727px; color: rgb(68, 68, 68); font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(255, 255, 255);&quot;&gt;If you want to cancel the shutdown timer you should use the flag &quot;-c&quot;:&lt;/p&gt;
&lt;p style=&quot;padding: 0px; line-height: 21.600000381469727px; color: rgb(68, 68, 68); font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(255, 255, 255);&quot;&gt;&lt;code style=&quot;padding: 0px; line-height: normal; font-size: 1.1em; font-family: 'Courier New', Courier, monospace;&quot;&gt;sudo shutdown -c&lt;/code&gt;&lt;/p&gt;
&lt;p style=&quot;padding: 0px; line-height: 21.600000381469727px; color: rgb(68, 68, 68); font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(255, 255, 255);&quot;&gt;You can also use the flag &quot;-r&quot; or &quot;-s&quot;, to reboot or make the system sleep.&lt;br style=&quot;padding: 0px; line-height: inherit;&quot;/&gt;
&lt;br/&gt;
Read &lt;code style=&quot;padding: 0px; line-height: normal; font-size: 1.1em; font-family: 'Courier New', Courier, monospace;&quot;&gt;man shutdown&lt;/code&gt; for further documentation. &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Create XML schema from XML file</title>
    <id>http://writings.miguelregedor.com/post/create-xml-schema-from-xml-file</id>
    <updated>2020-04-28T17:39:12.045000Z</updated>
    <published>2010-02-13T12:34:00Z</published>
    <link href="http://writings.miguelregedor.com/post/create-xml-schema-from-xml-file" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
Suppose you want to create a xsd based on an &quot;example.xml&quot; structure.
&lt;/div&gt;
&lt;div&gt;After download and extract &lt;a href=&quot;http://code.google.com/p/jing-trang/downloads/detail?name=trang-20090818.zip&quot;&gt;trang&lt;/a&gt; you can run it with:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;java -jar /trang.jar example.xml example.xsd&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;The &quot;example.xsd&quot; file generated may not be exactly what you need, but most of the time it is a good starting point.&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;To validate a xml file, for instance &quot;example.xml&quot;, against an xsd file,&lt;/div&gt;
&lt;div&gt;&quot;example.xsd&quot;, you can use the following command:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;xmllint --schema form.xsd ~/form.xml&lt;/code&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">ActionMailler and Gmail (no plugins)</title>
    <id>http://writings.miguelregedor.com/post/actionmailler-and-gmail-no-plugins</id>
    <updated>2020-04-28T17:39:19.618000Z</updated>
    <published>2009-10-17T15:51:00Z</published>
    <link href="http://writings.miguelregedor.com/post/actionmailler-and-gmail-no-plugins" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;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.3 gave me extra trouble. &lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Gmail requires TLS, older versions of ruby and rails do not support that, the work around was a pluging to enhance it (&lt;a href=&quot;http://github.com/openrain/action_mailer_tls/tree/master&quot;&gt;ActionMailerTLS&lt;/a&gt;). But if you are using Ruby 1.8.7 with Rails 2.2.1, or later versions, you don’t need plugins anymore, you only need to follow  this simple instructions.&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Add the following lines in your config/enviroments/production.rb&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;config.action_mailer.delivery_method = :smtp&lt;br/&gt;
config.action_mailer.smtp_settings = YAML.load File.open(&quot;#{RAILS_ROOT}/config/mailer.yml&quot;)&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;And then create the yaml file config/mailer.yml :&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;---&lt;br/&gt;
  :enable_starttls_auto: true # This is how you tell ActionMailler to use tls&lt;br/&gt;
  :address: &lt;a href=&quot;http://smtp.gmail.com/&quot;&gt;smtp.gmail.com&lt;/a&gt;&lt;br/&gt;
  :port: 587&lt;br/&gt;
  :domain: &lt;a href=&quot;http://gmail.com/&quot;&gt;gmail.com&lt;/a&gt;&lt;br/&gt;
  :user_name: my_username #You should type your username, you should not include the &lt;a href=&quot;mailto:%22@gmail.com&quot;&gt;&quot;@gmail.com&lt;/a&gt;&quot;.&lt;br/&gt;
  :password: my_password #You should type your password&lt;br/&gt;
  :authentication: :plain&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;That’s it!&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Now take a look in this notifier class example:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;class Notifier &lt; ActionMailer::Base&lt;br/&gt;
  def activation_instructions(user)&lt;br/&gt;
    @recipients  = &quot;#{user.email}&quot;&lt;br/&gt;
    #@from        = &quot;Miguel &lt;&lt;a href=&quot;mailto:my_username@gmail.com&quot;&gt;my_username@gmail.com&lt;/a&gt;&gt;&quot; # Doesn't work anymore&lt;br/&gt;
    @from        = &lt;a href=&quot;mailto:%22my_username@gmail.com&quot;&gt;&quot;my_username@gmail.com&lt;/a&gt;&quot;&lt;br/&gt;
    @subject    = &quot;[Card-Sorting] &quot;&lt;br/&gt;
    @sent_on    = Time.now&lt;br/&gt;
    @subject    += &quot;Important&quot;&lt;br/&gt;
    @body[:user] = user&lt;br/&gt;
  end&lt;br/&gt;
end&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;There is a lack of backward compatible. Due to some changes in the latest versions you cannot use that syntax anymore, if you are upgrading from old versions be careful, you should only simply specify your email to get it correctly parsed.&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Gato Fedorento - Esmiúça os Sufrágios</title>
    <id>http://writings.miguelregedor.com/post/gato-fedorento-esmiuca-os-sufragios</id>
    <updated>2015-03-05T08:16:11.533000Z</updated>
    <published>2009-09-15T23:38:00Z</published>
    <link href="http://writings.miguelregedor.com/post/gato-fedorento-esmiuca-os-sufragios" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;p&gt;Apenas uma referencia para quem me pediu os links:&lt;/p&gt;
&lt;p&gt;1º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=dvm2nhd-KtY&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=2fushE58VYw&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=XUZWLCvqCGU&quot;&gt;part3&lt;/a&gt; (José Sócrates)&lt;br /&gt;
2º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=cJsSim2OR2g&amp;amp;amp;feature=related&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=LV3g1YIjHKM&amp;amp;amp;feature=related&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=psQc3gJfOeo&amp;amp;amp;feature=related&quot;&gt;part3&lt;/a&gt; (Manuela Ferreira Leite)&lt;br /&gt;
3º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=kxACTEPkwNQ&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=R3Dr1BYvrA4&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=khgOUZPuQOc&quot;&gt;part3&lt;/a&gt; (Paulo Portas)&lt;br /&gt;
4º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=jbDI6PMsa6s&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=G7n1x163GCk&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=Y-5iVunZCno&quot;&gt;part3&lt;/a&gt; (Francisco Louçã)&lt;br /&gt;
5º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=_Ln0KTuS1zc&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=Aep2XHNFJOw&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=qe4dfSRhKbI&quot;&gt;part3&lt;/a&gt; (Paulo Rangel)&lt;br /&gt;
6º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=tANkJ_bvd3g&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=QYZKMId7kCQ&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=IkCUNJczhFo&quot;&gt;part3&lt;/a&gt; (Jerónimo de Sousa )&lt;br /&gt;
7º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=sbjXI88896o&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=ZeeZiJ3WqV8&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=sQabk1uA3Co&quot;&gt;part3&lt;/a&gt; (Joana Amaral DIas )&lt;br /&gt;
8º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=LfLhuetJ_Mw&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=KmtJeDguvjo&quot;&gt;part2&lt;/a&gt; (Ministro Teixeira dos Santos )&lt;br /&gt;
9º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=rcDwJu0SpKI&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=e3UXjlt68gs&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=3_UfwLwEFeo&quot;&gt;part3&lt;/a&gt; (Maria José Nogueira Pinto )&lt;br /&gt;
10º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=uLNAhzzpWSE&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=0ds6yCklDBQ&quot;&gt;part2&lt;/a&gt; (Garcia Pereira )&lt;br /&gt;
11º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=l9rjxFopwZM&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=E--JOypVeeo&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=-GHsOM6wox8&quot;&gt;part3&lt;/a&gt; (António Costa )&lt;br /&gt;
12º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=qXqGHC7iWd4&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=lGxzc_b9ahM&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=S91ZnK_jGF8&quot;&gt;part3&lt;/a&gt; (Pedro Santana Lopes)&lt;br /&gt;
13º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=xfVo1Hb9cjg&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=s_cxAfw-Iyc&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=RbT1kzvu_7I&quot;&gt;part3&lt;/a&gt; (Rui Rio)&lt;br /&gt;
14º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=-QZyjbge-II&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=DUy0gPMO8ZU&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=UxKE7iqBCFU&quot;&gt;part3&lt;/a&gt; (Luis Filipe Menezes)&lt;br /&gt;
15º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=5yjLcpJ6TmA&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=S-P98RPl6nw&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=CcZTsQ5RNgo&quot;&gt;part3&lt;/a&gt; (Mário Soares)&lt;br /&gt;
16º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=OEeGmCfc3rA&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=FXPphvhsvAk&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=3Ee8MoGOCQU&quot;&gt;part3&lt;/a&gt; (Pedro Passos Coelho)&lt;br /&gt;
17º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=3cEs_Uz0Xl4&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=rygBkMZlkzE&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=PznFX0Ly6aY&quot;&gt;part3&lt;/a&gt; (Elisa Ferreira)&lt;br /&gt;
18º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=zErVsgslshY&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=kUk7EnyQkxM&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=vfvdhlDts7E&quot;&gt;part3&lt;/a&gt; (Marques Mendes)&lt;br /&gt;
19º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=LHu_31cUl14&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=rxEzwdVIVQc&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=x74etsW6GD&quot;&gt;part3&lt;/a&gt; (António Marinho Pinto)&lt;br /&gt;
20º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=beS9VwoZXMU&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=BKZgIdw6REI&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=Vuz1upQDf14&quot;&gt;part3&lt;/a&gt; (Nuno Melo)&lt;br /&gt;
21º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=wsRyvP2W74E&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=9HkbEHvaAbU&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=E5tFKA-Uk0o&quot;&gt;part3&lt;/a&gt; (Jorge Coelho)&lt;br /&gt;
22º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=U24KsFL8c4c&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=TLIdA6ZrWuo&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=qKsiKJaIJs0&quot;&gt;part3&lt;/a&gt; (Francisco Moita Flores)&lt;br /&gt;
23º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=6tU4CXqeCyU&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=m5SAzMZKbv0&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=dCOnm4P5ocg&quot;&gt;part3&lt;/a&gt; (Mário Lino)&lt;br /&gt;
24º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=x9N76z8JTQg&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=nIftjUUvfSU&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=5wZVNn3D080&quot;&gt;part3&lt;/a&gt; (General Ramalho Eanes)&lt;br /&gt;
25º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=seHq61TdFHk&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=VIb19JhI8L0&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=099e6bDEfLs&quot;&gt;part3&lt;/a&gt; (Bernardino Soares)&lt;br /&gt;
26º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=gJzEPXkf1VM&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=3csRlOWnCac&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=oTCX23j5Qto&quot;&gt;part3&lt;/a&gt; (Marcelo Rebelo de Sousa)&lt;br /&gt;
27º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=SXmtjLzsA4M&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=C3xPciQvrak&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=4Ocn6W1kFhQ&quot;&gt;part3&lt;/a&gt; (Francisco Assis, José Pedro Aguiar Branco)&lt;br /&gt;
28º Episódio - &lt;a href=&quot;http://www.youtube.com/watch?v=G_wTmJRZQgA&quot;&gt;part1&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=QhiJJfpslzQ&quot;&gt;part2&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=EQhHMkRe99s&quot;&gt;part3&lt;/a&gt;, &lt;a href=&quot;http://www.youtube.com/watch?v=8PTxqXICKS4&quot;&gt;part4&lt;/a&gt; (José Alberto de Carvalho, Julio Magalhães, Rodrigo Guedes de Carvalho)&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Change default user shell</title>
    <id>http://writings.miguelregedor.com/post/change-default-user-shell</id>
    <updated>2020-04-28T17:39:18.648000Z</updated>
    <published>2009-06-27T23:42:00Z</published>
    <link href="http://writings.miguelregedor.com/post/change-default-user-shell" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
Example of how to use chsh command to change current user shell to bash:
&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;chsh -s /bin/bash&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Hash to Object</title>
    <id>http://writings.miguelregedor.com/post/hash-to-object</id>
    <updated>2020-04-28T17:39:12.603000Z</updated>
    <published>2009-05-01T11:25:00Z</published>
    <link href="http://writings.miguelregedor.com/post/hash-to-object" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
Sometimes I have the need to create objects that responds to some methods with a specific values.
&lt;/div&gt;
&lt;div&gt;Something that I can use like&lt;/div&gt;
&lt;div&gt;HashObject.new :method1 =&gt; value_for_method1, :method2 =&gt; value_for_method2&lt;/div&gt;
&lt;div&gt;There is already a way to do it, with OpenStruct, but I created a HashObject. Just for academic proposals. I didn't knew the OpenStruct at the time.&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;class&lt;/span&gt; HashObject&lt;/div&gt;
&lt;div&gt;  &lt;span style='color:#800000;font-weight:bold;'&gt;def&lt;/span&gt; initialize&lt;span style='color:#808030;'&gt;(&lt;/span&gt;hash&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;    hash&lt;span style='color:#808030;'&gt;.&lt;/span&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;each&lt;/span&gt; &lt;span style='color:#800000;font-weight:bold;'&gt;do&lt;/span&gt; |k,v|&lt;/div&gt;
&lt;div&gt;      &lt;span style='color:#800000;font-weight:bold;'&gt;self&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;instance_variable_set&lt;span style='color:#808030;'&gt;(&lt;/span&gt;&lt;span style='color:#0000e6;'&gt;&quot;@#{k}&quot;&lt;/span&gt;, v&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;      &lt;span style='color:#800000;font-weight:bold;'&gt;self&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;class&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;send&lt;span style='color:#808030;'&gt;(&lt;/span&gt;:define_method, k, &lt;span style='color:#400000;'&gt;proc&lt;/span&gt;&lt;span style='color:#800080;'&gt;{&lt;/span&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;self&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;instance_variable_get&lt;span style='color:#808030;'&gt;(&lt;/span&gt;&lt;span style='color:#0000e6;'&gt;&quot;@#{k}&quot;&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;span style='color:#800080;'&gt;}&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;      &lt;span style='color:#800000;font-weight:bold;'&gt;self&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;class&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;send&lt;span style='color:#808030;'&gt;(&lt;/span&gt;:define_method, &lt;span style='color:#0000e6;'&gt;&quot;#{k}=&quot;&lt;/span&gt;, &lt;span style='color:#400000;'&gt;proc&lt;/span&gt;&lt;span style='color:#800080;'&gt;{&lt;/span&gt;|v| &lt;span style='color:#800000;font-weight:bold;'&gt;self&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;instance_variable_set&lt;span style='color:#808030;'&gt;(&lt;/span&gt;&lt;span style='color:#0000e6;'&gt;&quot;@#{k}&quot;&lt;/span&gt;, v&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;span style='color:#800080;'&gt;}&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;    &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;  &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;  &lt;span style='color:#800000;font-weight:bold;'&gt;def&lt;/span&gt; to_hash&lt;/div&gt;
&lt;div&gt;    hash_to_return &lt;span style='color:#808030;'&gt;=&lt;/span&gt; &lt;span style='color:#800080;'&gt;{&lt;/span&gt;&lt;span style='color:#800080;'&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;    &lt;span style='color:#800000;font-weight:bold;'&gt;self&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;instance_variables&lt;span style='color:#808030;'&gt;.&lt;/span&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;each&lt;/span&gt; &lt;span style='color:#800000;font-weight:bold;'&gt;do&lt;/span&gt; |var|&lt;/div&gt;
&lt;div&gt;      hash_to_return&lt;span style='color:#808030;'&gt;[&lt;/span&gt;var&lt;span style='color:#808030;'&gt;.&lt;/span&gt;&lt;span style='color:#400000;'&gt;gsub&lt;/span&gt;&lt;span style='color:#808030;'&gt;(&lt;/span&gt;&lt;span style='color:#0000e6;'&gt;&quot;@&quot;&lt;/span&gt;,&lt;span style='color:#0000e6;'&gt;&quot;&quot;&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;span style='color:#808030;'&gt;]&lt;/span&gt; &lt;span style='color:#808030;'&gt;=&lt;/span&gt; &lt;span style='color:#800000;font-weight:bold;'&gt;self&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;instance_variable_get&lt;span style='color:#808030;'&gt;(&lt;/span&gt;var&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;    &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;    &lt;span style='color:#800000;font-weight:bold;'&gt;return&lt;/span&gt; hash_to_return&lt;/div&gt;
&lt;div&gt;  &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Git push to remote non default port</title>
    <id>http://writings.miguelregedor.com/post/git-push-to-remote-non-default-port</id>
    <updated>2020-04-28T17:39:16.189000Z</updated>
    <published>2009-04-30T23:44:00Z</published>
    <link href="http://writings.miguelregedor.com/post/git-push-to-remote-non-default-port" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
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:
&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;  git push ssh://remote_user@domain.com:remote_port/~/remote_repository remote_branch&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Object.tot</title>
    <id>http://writings.miguelregedor.com/post/object-tot</id>
    <updated>2020-04-28T17:39:12.182000Z</updated>
    <published>2009-04-24T11:20:00Z</published>
    <link href="http://writings.miguelregedor.com/post/object-tot" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
I know Rails 2.3 is out and has a new &quot;try&quot; 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 lolol) so that you can use it anywhere like in the example:
&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;tot &lt;span style='color:#800000;font-weight:bold;'&gt;do&lt;/span&gt; params&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:search&lt;span style='color:#808030;'&gt;]&lt;/span&gt;&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:name&lt;span style='color:#808030;'&gt;]&lt;/span&gt; &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;or like that&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;tot&lt;span style='color:#808030;'&gt;(&lt;/span&gt;:also &lt;span style='color:#808030;'&gt;=&lt;/span&gt;&gt; &lt;span style='color:#808030;'&gt;[&lt;/span&gt;&lt;span style='color:#0000e6;'&gt;&quot;&quot;&lt;/span&gt;,&lt;span style='color:#0000e6;'&gt;&quot;nome feio&quot;&lt;/span&gt;&lt;span style='color:#808030;'&gt;]&lt;/span&gt;, &lt;span style='color:#800000;font-weight:bold;'&gt;return&lt;/span&gt; &lt;span style='color:#808030;'&gt;=&lt;/span&gt;&gt; &lt;span style='color:#0000e6;'&gt;&quot;nome invalido&quot;&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt; &lt;span style='color:#800000;font-weight:bold;'&gt;do&lt;/span&gt; params&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:search&lt;span style='color:#808030;'&gt;]&lt;/span&gt;&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:name&lt;span style='color:#808030;'&gt;]&lt;/span&gt; &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;this last example case will return &quot;nome invalido&quot; in case of params[:search][:name] being empty string, &quot;nome feio&quot;, or if a NoMethodError happens&quot;, other wise it will return params[:search][:name] value&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;And that is my code extending object class.&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;class&lt;/span&gt; Object&lt;/div&gt;
&lt;div&gt;  &lt;span style='color:#800000;font-weight:bold;'&gt;def&lt;/span&gt; tot&lt;span style='color:#808030;'&gt;(&lt;/span&gt;options &lt;span style='color:#808030;'&gt;=&lt;/span&gt; &lt;span style='color:#800080;'&gt;{&lt;/span&gt;&lt;span style='color:#800080;'&gt;}&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;    &lt;span style='color:#800000;font-weight:bold;'&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;      &lt;span style='color:#808030;'&gt;(&lt;/span&gt;options&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:also&lt;span style='color:#808030;'&gt;]&lt;/span&gt; &lt;span style='color:#800000;font-weight:bold;'&gt;and&lt;/span&gt; options&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:also&lt;span style='color:#808030;'&gt;]&lt;/span&gt;&lt;span style='color:#808030;'&gt;.&lt;/span&gt;include?&lt;span style='color:#808030;'&gt;(&lt;/span&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;yield&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt;&lt;span style='color:#808030;'&gt;)&lt;/span&gt; ? options&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:&lt;span style='color:#800000;font-weight:bold;'&gt;return&lt;/span&gt;&lt;span style='color:#808030;'&gt;]&lt;/span&gt; : &lt;span style='color:#800000;font-weight:bold;'&gt;yield&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;      &lt;span style='color:#800000;font-weight:bold;'&gt;rescue&lt;/span&gt; NoMethodError&lt;/div&gt;
&lt;div&gt;      options&lt;span style='color:#808030;'&gt;[&lt;/span&gt;:&lt;span style='color:#800000;font-weight:bold;'&gt;return&lt;/span&gt;&lt;span style='color:#808030;'&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;    &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;  &lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style='color:#800000;font-weight:bold;'&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;I found it funny, anyway Ruby on Rails got it's own try method built in some months later.&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Git clone from remote repository with ssh and non default port</title>
    <id>http://writings.miguelregedor.com/post/git-clone-from-remote-repository-with-ssh-and-non-default-port</id>
    <updated>2020-04-28T17:39:12.700000Z</updated>
    <published>2009-04-11T11:17:00Z</published>
    <link href="http://writings.miguelregedor.com/post/git-clone-from-remote-repository-with-ssh-and-non-default-port" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;Just a reminder, suppose your ssh port is 3022: (sometimes I swap the way to specify the port in those two commands)&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;git clone ssh&lt;span style='color:#808030;'&gt;:&lt;/span&gt;&lt;span style='color:#40015a;'&gt;/&lt;/span&gt;&lt;span style='color:#40015a;'&gt;/user&lt;/span&gt;@domain&lt;span style='color:#800000;font-weight:bold;'&gt;.&lt;/span&gt;com&lt;span style='color:#808030;'&gt;:&lt;/span&gt;&lt;span style='color:#008c00;'&gt;3022&lt;/span&gt;&lt;span style='color:#40015a;'&gt;/&lt;/span&gt;~&lt;span style='color:#40015a;'&gt;/Projects/my_project&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;ssh user@domain&lt;span style='color:#800000;font-weight:bold;'&gt;.&lt;/span&gt;com &lt;span style='color:#44aadd;'&gt;-p&lt;/span&gt; &lt;span style='color:#008c00;'&gt;3022&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;(when connecting through ssh the non default port goes as param, the default port is 22)&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;You can also add the host to your ~/ssh/config so you don’t need to add the port every time you use ssh/git:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;Host *example.com&lt;/div&gt;
&lt;div&gt;    Port 3022&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Git diff pacth</title>
    <id>http://writings.miguelregedor.com/post/git-diff-pacth</id>
    <updated>2020-04-28T17:39:12.533000Z</updated>
    <published>2009-03-21T12:28:00Z</published>
    <link href="http://writings.miguelregedor.com/post/git-diff-pacth" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
How to create a patch with git diff:
&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;git diff HEAD~&lt;span style='color:#008c00;'&gt;2&lt;/span&gt; &lt;span style='color:#e34adc;'&gt;&gt;&lt;/span&gt; changes&lt;span style='color:#800000;font-weight:bold;'&gt;.&lt;/span&gt;diff&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;How to use it:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre style='color:#000000;background:#ffffff;'&gt;patch -Np2 -i changes&lt;span style='color:#800000;font-weight:bold;'&gt;.&lt;/span&gt;diff&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;thanks to Andy ;)&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Get all values of a single column efficiently</title>
    <id>http://writings.miguelregedor.com/post/get-all-values-of-a-single-column-efficiently</id>
    <updated>2020-04-28T17:39:18.886000Z</updated>
    <published>2009-02-25T14:46:00Z</published>
    <link href="http://writings.miguelregedor.com/post/get-all-values-of-a-single-column-efficiently" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;
Imagine you want this:
&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;@names = MyModel.find(:all).map{ |i| &lt;a href=&quot;http://i.name&quot;&gt;i.name&lt;/a&gt; }.uniq&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Yes, that works! You get all distinct names of one column, you can even do something like that:&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;#Using Shortcut Blocks with Symbol to_proc&lt;/div&gt;
&lt;div&gt;@names = MyModel.all.map(&amp;:name).uniq&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Cool, rely small code(almost seems I'm using Haskel) but not that efficient if your model's table has lots of columns. (Imagine! The whole table is being loaded to memory) So what is the solution?&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;MyModel.find( :all, :select &gt; 'DISTINCT name' )&lt;/div&gt;
&lt;div&gt;```&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;If you specify wich columns you need, in the sql query, you will spare some memory. And in my earlier example you can also pass the &quot;uniq&quot; work to the database.&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Rewrite humanize</title>
    <id>http://writings.miguelregedor.com/post/rewrite-humanize</id>
    <updated>2018-11-09T23:19:14.365000Z</updated>
    <published>2009-01-30T17:24:00Z</published>
    <link href="http://writings.miguelregedor.com/post/rewrite-humanize" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;I have an application with all tables and field names in English, but the whole views now need to be in Portuguese.&lt;/p&gt;
&lt;p&gt;Because I’m always using the humanize method, a simple solutions should emerge.&lt;/p&gt;
&lt;p&gt;First solution:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
class Ticket

  HUMANIZED_ATTRIBUTES = {

    :category &amp;gt; &amp;quot;Categoria&amp;quot;,

    :title &amp;gt; &amp;quot;Assunto&amp;quot;

  }

  def self.human_attribute_name(attr)

    HUMANIZED_ATTRIBUTES[attr.to_sym] || super

  end

end

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Setting the human_attribue_name in each model works ok, but if like in my case, you have 20 models and all of them have a description, title,… much duplication…&lt;/p&gt;
&lt;p&gt;So I thought in doing something similar to this in my enviroment.rb:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
Inflector.inflections do |inflect|

  inflect.plural /^(foo)$/i, '\1ze'

  inflect.singular /^(foo)ze/i, '\1'

end

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But for the humanized method instead of pluralize. Yah It would make sense that way, but rails doesn’t provide that feature. You can go here to find a patch for getting that functionality into your rails, I hope they get that into the core… anyway If didn’t want to download the patch, how do I solve the problem?&lt;/p&gt;
&lt;p&gt;Maybe a rubbish solution but perfect to get what I was needing, translate my views with few lines of code! What I’ve done? Just added those lines into my environment.rb&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
class String

  def humanize

    {:movie              =&amp;gt; &amp;quot;Filme&amp;quot;,

     :movies             =&amp;gt; &amp;quot;Filmes&amp;quot;,

     :name               =&amp;gt; &amp;quot;Nome&amp;quot;,

     :title              =&amp;gt; &amp;quot;Título&amp;quot;,

     :synopsis           =&amp;gt; &amp;quot;Sinopse&amp;quot;,

     :genre              =&amp;gt; &amp;quot;Genero&amp;quot;,

     :author             =&amp;gt; &amp;quot;Autor&amp;quot;,

     :authors            =&amp;gt; &amp;quot;Autores&amp;quot;

     ...

    }[self.gsub(/_id$/, &amp;quot;&amp;quot;).to_sym] || super

  end

end

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I simply redefined the humanize method for whole strings. It works perfectly in my case, because I’m always calling humanize in my views.&lt;/p&gt;
&lt;p&gt;keep humanizing the world!&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Ruby on Rails no Ubuntu</title>
    <id>http://writings.miguelregedor.com/post/ruby-on-rails-no-ubuntu</id>
    <updated>2016-08-05T01:35:32.828000Z</updated>
    <published>2009-01-24T00:56:00Z</published>
    <link href="http://writings.miguelregedor.com/post/ruby-on-rails-no-ubuntu" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;div&gt;
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.
&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Não deve ser necessário editar os repositórios. Mas fica o comando apenas para referencia.&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;sudo vim /etc/apt/sources.list&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Pode pensar que full-upgrade inclui o safe-upgrade, mas é mentira são comandos diferentes. Portanto aconselho a intoduzir os dois pela seguinte ordem:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;sudo aptitude safe-upgrade&lt;/div&gt;
&lt;div&gt;sudo aptitude full-upgrade&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Nesta fase é responder Yes a todas as perguntas!&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;sudo aptitude install build-essential&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;(Como disse estou a descrever os passos exactos que executei após a instalação do SO)&lt;/div&gt;
&lt;div&gt;Agora sim vamos ao importante:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;sudo aptitude install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby sqlite3 libsqlite3-ruby1.8&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Criar alguns symlinks:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby&lt;/div&gt;
&lt;div&gt;sudo ln -s /usr/bin/ri1.8 /usr/bin/ri&lt;/div&gt;
&lt;div&gt;sudo ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc&lt;/div&gt;
&lt;div&gt;sudo ln -s /usr/bin/irb1.8 /usr/bin/irb&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Agora vamos instalar o rubygems que nos oferece o comando gem, uma espécie de aptitude para o ruby.&lt;/div&gt;
&lt;div&gt;Deve verificar qual a ultima versão de rubygems(http://rubyforge.org/projects/rubygems/), no caso de existir uma versão mais recente, substituir no comando em baixo.&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;wget &lt;a href=&quot;http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz&quot;&gt;http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;tar xzvf rubygems-1.3.1.tgz&lt;/div&gt;
&lt;div&gt;cd  rubygems-1.3.1&lt;/div&gt;
&lt;div&gt;sudo ruby setup.rb&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Criar symlink e garantir que temos o rubygems actualizado&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;sudo ln -s /usr/bin/gem1.8 /usr/bin/gem&lt;/div&gt;
&lt;div&gt;sudo gem update&lt;/div&gt;
&lt;div&gt;sudo gem update --system&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;E finalmente instalar o Ruby on Rails.&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;sudo gem install rails&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Confirmar que tudo correu bem.&lt;/div&gt;
&lt;div&gt;&lt;code&gt;sudo gem list&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;Devemos obter uma lista deste genero:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;*** LOCAL GEMS ***&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;actionmailer (2.2.2)&lt;/div&gt;
&lt;div&gt;actionpack (2.2.2)&lt;/div&gt;
&lt;div&gt;activerecord (2.2.2)&lt;/div&gt;
&lt;div&gt;activeresource (2.2.2)&lt;/div&gt;
&lt;div&gt;activesupport (2.2.2)&lt;/div&gt;
&lt;div&gt;rails (2.2.2)&lt;/div&gt;
&lt;div&gt;rake (0.8.3)&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Verificar a operabilidade do sistema de base de dados sqlite:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;irb&lt;/div&gt;
&lt;div&gt;.......&lt;/div&gt;
&lt;div&gt;irb(main):001:0&gt; require 'sqlite3'&lt;/div&gt;
&lt;div&gt;=&gt; true&lt;/div&gt;
&lt;div&gt;irb(main):002:0&gt; exit&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Para criar o primeiro projecto:&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;rails nome_do_meu_projecto&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Já agora instalar o rmagick possivelmente tambem será util para a maioria dos projectos.&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;/div&gt;
&lt;div&gt;  sudo aptitude install imagemagick&lt;/div&gt;
&lt;div&gt;  sudo aptitude install libmagick9-dev&lt;/div&gt;
&lt;div&gt;  sudo gem install rmagick&lt;/div&gt;
&lt;div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;Agora é só por mãos a obra... e talvez arranjar um bom editor. Aconselho o textmate ou o vim, descreverei em breve como configurar e instalar alguns plugins para rails, no caso de escolher o vim.&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">How to Install Skype (Ubuntu)</title>
    <id>http://writings.miguelregedor.com/post/how-to-install-skype-ubuntu</id>
    <updated>2015-03-05T08:16:11.669000Z</updated>
    <published>2009-01-23T00:55:00Z</published>
    <link href="http://writings.miguelregedor.com/post/how-to-install-skype-ubuntu" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;Easy as it is. Just add the repository into your rep. list, update the package information and install Skype.&lt;/p&gt;
&lt;p&gt;Open your list:&lt;br /&gt;
sudo vim /etc/apt/sources.list&lt;/p&gt;
&lt;p&gt;Add this line at the end:&lt;br /&gt;
deb &lt;a href=&quot;http://download.skype.com/linux/repos/debian/&quot;&gt;http://download.skype.com/linux/repos/debian/&lt;/a&gt; stable non-free&lt;/p&gt;
&lt;p&gt;Update:&lt;br /&gt;
sudo aptitude update&lt;/p&gt;
&lt;p&gt;Install skype, answer yes to all question(but think for your self!)&lt;br /&gt;
sudo aptitude install skype&lt;/p&gt;
&lt;p&gt;If you have some problems with audio(like I had) try this lines:&lt;/p&gt;
&lt;p&gt;killall pulseaudio&lt;br /&gt;
sudo aptitude remove pulseaudio&lt;br /&gt;
sudo aptitude install esound&lt;br /&gt;
sudo rm /etc/X11/Xsession.d/70pulseaudio&lt;/p&gt;
&lt;p&gt;(I'm using Ubuntu 8.10, but also works with Ubuntu 9.10)&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Awareness Test</title>
    <id>http://writings.miguelregedor.com/post/awareness-test</id>
    <updated>2018-10-25T00:37:27.035000Z</updated>
    <published>2009-01-09T11:55:00Z</published>
    <link href="http://writings.miguelregedor.com/post/awareness-test" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;I love &lt;a href=&quot;http://www.youtube.com/watch?v=2cd63P54PaI&quot;&gt;this videos&lt;/a&gt; from the dothetest campaign.&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">PayPal Payments Standard, Subscriptions and IPN with Ruby on Rails.</title>
    <id>http://writings.miguelregedor.com/post/paypal-payments-standard-subscriptions-and-ipn-with-ruby-on-rails</id>
    <updated>2020-04-28T17:39:13.541000Z</updated>
    <published>2008-12-05T01:07:00Z</published>
    <link href="http://writings.miguelregedor.com/post/paypal-payments-standard-subscriptions-and-ipn-with-ruby-on-rails" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;div&gt;Hi there!&lt;/div&gt;
&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt;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 find out what you want, I'm sure they like treasure hunt   games, I remember to following  10 steps, described on a pdf,  to download a sample code, (you should click this link, and now try to find a small square in the middle of the page, press it  and then you should close your eyes for about... crazy weirdoes) anyway... my goal was to implement a subscription system for &lt;a title=&quot;laurelandhardyarchive&quot; href=&quot;http://www.laurelandhardyarchive.com/&quot;&gt;laurelandhardyarchive&lt;/a&gt;, and of course because is subscriptions, with PayPal at UK, with IPN, and using rails, everything seems to be a little more difficult (only at the beginning ;)), PayPal doesn’t provide any ruby samples, and there is a good plugin Active Merchant, but again because it's subscription, the documentations also fails(not only for subscriptions, the whole Active Merchant  has a lack of documentation). With that scenario I figure out the best way to solve the problem was to build my own gem to deal with that, the gem should be finished soon, but anyway I leave you a small brief of what is needed to accomplish this, and I leave you some links, so that way you don’t need to a treasure hunt throw PayPal web site.&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt;So... do you need to integrate PayPal subscriptions and IPN into your web site?&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt;For starting you should register into &lt;a title=&quot;paypal developer page&quot; href=&quot;https://developer.paypal.com/&quot; target=&quot;_blank&quot;&gt;developer PayPal&lt;/a&gt; then you should create two sandbox PayPal  accounts to do your tests (you can use the preconfigured account button for those, but be aware to chose country US even if you are in UK, because you will have troubles to activate the test account, but don’t worry you real account should not have any problems based in the country),  one of the account should be busyness type and the other personal type account, you will use them  to simulate the seller and buyer roles, don't forget to start the personal account (the buyers one) with some money(fake money) you can do that while creating it, click the advanced otptions drop down.&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt;So right now you can use your business account to create code for subscription buttons. For doing that you should access PayPal sandbox, in the developers page (when listing the accounts) you have a link for that. PayPal sandbox is a complete copy of the original PayPal web site, and all test accounts can interact in this closed world.&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt;This is all for now. I'll try to post some code latter. In any case if you're trying to achive something similar and having some difficulties, leave me a message, if have the knowledge to I be glade to help.&lt;/div&gt;&lt;/div&gt;
</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">E o semestre acabou</title>
    <id>http://writings.miguelregedor.com/post/e-o-semestre-acabou</id>
    <updated>2015-03-05T08:16:11.700000Z</updated>
    <published>2008-02-23T11:39:00Z</published>
    <link href="http://writings.miguelregedor.com/post/e-o-semestre-acabou" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;p&gt;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ão centenas, são apenas de dezenas… Pronto às vezes chega a ter uma dezena…  mas é uma dezena larga, e é gente interessante por isso merece este pedido de desculpas.&lt;br /&gt;
Estive, estes últimos dois meses, ocupadíssimo com trabalhos e exames. Bolonha veio alterar completamente o ritmo de trabalho, pelo menos na Universidade do Minho. Não digo que seja injusto ter-mos mais trabalho, há muita coisa que estava mal e que me parece poder beneficiar com Bolonha caso esta seja executada convenientemente. Tenho a sensação que ainda ninguém está habituado a esta nova etapa. É normal surgirem complicações num período de adaptação… Aguardo então ansiosamente pelo próximo semestre, e espero que desta vez as coisas corram melhor e não cheguemos ao fim com uma semana para entregar trabalhos, fazer “testes&quot; (testes esses que na verdade são os exames que antes estavam espalhados ao longo de um mes) e tudo isto com extrema falta de coordenação (pelo menos foi isto que se passou no meu curso, LESI ou LEI) pois nem se sabia ao certo datas, horas, salas disponíveis para os exames etc… Acredito que tenha servido de lição, e espero por algo melhor ao longo dos próximos meses!&lt;br /&gt;
De qualquer forma terminou o semestre e estas cadeiras já estão todas feitas.=)&lt;br /&gt;
Ao longo destes dois meses, e enquanto fazia alguns destes trabalhos tb tive oportunidade para aprofundar os meus conhecimentos de RoR (Ruby on Rails)por sinal uma Framework muito interessante. Espero, agora que a tempestade passou, poder voltar a escrever algo neste blog e tecer alguns comentários por exemplo acerca de algumas cabeçadas que dei no rails ao longo do trabalho de BD!&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">VIM for beginners</title>
    <id>http://writings.miguelregedor.com/post/vim-for-beginners</id>
    <updated>2020-04-28T17:39:06.831000Z</updated>
    <published>2007-12-05T16:58:00Z</published>
    <link href="http://writings.miguelregedor.com/post/vim-for-beginners" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="english" />
    <content type="html">&lt;p&gt;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 I was, used to Windows and GUIs but make no mistake, there is a good reason for this 30-year old tool still be widely used by many of the best developers in the world. &lt;/p&gt;
&lt;p&gt;A few days ago, I was programming some rails application, while doing some changes to a few files, I realized that I wasn’t taking full advantage of vim, I couldn’t do what I normally saw my teachers doing, like indenting a text with few keyboard shortcuts. So I spendt some hours reading the vim help and realized how fantastic vim is! Now if you wanna try vi I will give some little tips, like a mini tutorial for vi/vim beginners.&lt;/p&gt;
&lt;p&gt;For showing you the shortcuts I’ll use a similar notation to the used on vim help. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;ESC&amp;gt;&amp;lt;CTRL-v&amp;gt;5jI
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This means you press &lt;strong&gt;ESC&lt;/strong&gt; key then you press &lt;strong&gt;Ctrl&lt;/strong&gt; and &lt;strong&gt;v&lt;/strong&gt; key simultaneous then you press the number 5 followed by the &lt;strong&gt;j&lt;/strong&gt; key and finally you press &lt;strong&gt;I&lt;/strong&gt;. I think you get the idea. If you can’t, vim isn’t for you!&lt;/p&gt;
&lt;p&gt;First, Vim has something similar to a command line, when you press &lt;strong&gt;&lt;ESC&gt;&lt;/strong&gt; you will start writing commands at the bottom of the screen for example, &lt;strong&gt;:q&lt;/strong&gt; is for quitting the program. Of course when I say something started with &lt;strong&gt;:&lt;/strong&gt; like &lt;strong&gt;:q&lt;/strong&gt; I’m expecting you to write that on the command line, not in your text, so if you are in insert mode you have to do something like this &lt;strong&gt;&lt;ESC&gt;:q&lt;ENTER&gt;&lt;/strong&gt; Well… now when talked about insert mode I introduced one more thing; the vi working modes! When using vim, you can switch between different working modes, for example to insert text you should be on INSERT MODE, when selecting text you are on SELECTION MODE, you have also REPLACE MODE, VISUAL MODE, and more. Those operating modes give you ultrafast access to key commands that can edit, insert, and move text on-the-fly.&lt;/p&gt;
&lt;p&gt;Here are some examples of commands:&lt;/p&gt;
&lt;p&gt;Calling VIM:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Vi                 Open vim with no file.

vi PATH            Open PATH file with vim, if the file doesn’t exist create it.

vi PATH +          Open the PATH file and focus cursor at end of file.

vi PATH +10        Open file at line 10.

vi PATH +/regedor  Open file with courser at the first occurrence of  the word &quot;regedor&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Saving/Quitting VIM:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:w                Save

:q                Exit without saving

:wq or : x or ZZ  Exit and save

:w!               Force Save

:q!               Force Quit

:wq!              Force Save and Quit
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Well this is good for beginners. For now I don’t have more time, I will set up a more complex tutorial with a few more advanced commands soon.&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Finntroll</title>
    <id>http://writings.miguelregedor.com/post/finntroll</id>
    <updated>2015-03-05T08:16:11.726000Z</updated>
    <published>2007-10-20T23:53:00Z</published>
    <link href="http://writings.miguelregedor.com/post/finntroll" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;p&gt;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. Uma mistura de folk, humpa(musica tradicional de bebados filândeses &quot;segundo o vorph&quot;), e claro Black Metal!&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;container-embed&quot;&gt;
  &lt;div class=&quot;embed-inner&quot;&gt;
    &lt;div class=&quot;embed-left&quot;&gt;
      &lt;div class=&quot;embed-illustration nut-sad&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;embed-right&quot;&gt;
      &lt;span class=&quot;embed-title&quot;&gt;Uh oh, it looks like your embed code is broken.&lt;/span&gt;
      &lt;br /&gt;
      &lt;span class=&quot;embed-name&quot;&gt;&lt;a href=&quot;http://docs.postach.io/embed-codes#youtube&quot; target=&quot;_blank&quot;&gt;Learn more about embedding youtube&lt;/a&gt;&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Paco de Lúcia em Lisboa</title>
    <id>http://writings.miguelregedor.com/post/paco-de-lucia-em-lisboa</id>
    <updated>2015-03-05T08:16:11.756000Z</updated>
    <published>2007-10-16T23:51:00Z</published>
    <link href="http://writings.miguelregedor.com/post/paco-de-lucia-em-lisboa" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;p&gt;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 espectáculo em que apresentará alguns temas do seu mais recente álbum, &quot;Cositas buenas&quot;.&lt;/p&gt;
&lt;p&gt;Paco de Lucía, de 59 anos, tem editados cerca de 30 discos, além de várias participações em trabalhos de outros músicos ou cantores.&lt;/p&gt;
&lt;p&gt;Com Paco de Lucía, sobem ao palco do Campo Pequeno Alain Pérez (baixo), Daniel Lopez Vicente (guitarra clássica), Domingo Patrício (teclados), Israel Suárez (cajón) e Asunción Herédia e Montserrat Cortés (coros).&lt;/p&gt;
&lt;p&gt;Tanto eu como o meu amigo João gostaríamos de comparecer a este concerto, mas como vai ser em Lisboa (tal qual os últimos concertos de relevo) fica bastante caro bilhete+transporte. Deixo então o apelo, quem tiver vontade (e um carro, pois também nos falta carro) de ver este concerto, entre em contacto para assim dividirmos custos da viagem.&lt;/p&gt;
&lt;p&gt;Faltou apenas mencionar o preço dos bilhetes. Se não estou em erro é aproximadamente entre 25 € e 80 € dependendo do lugar.&lt;/p&gt;
&lt;p&gt;Deixo-vos com Paco De Lucia, John Mclaughlin e Al Di Meola.&lt;br /&gt;
&lt;div class=&quot;container-embed&quot;&gt;
  &lt;div class=&quot;embed-inner&quot;&gt;
    &lt;div class=&quot;embed-left&quot;&gt;
      &lt;div class=&quot;embed-illustration nut-sad&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;embed-right&quot;&gt;
      &lt;span class=&quot;embed-title&quot;&gt;Uh oh, it looks like your embed code is broken.&lt;/span&gt;
      &lt;br /&gt;
      &lt;span class=&quot;embed-name&quot;&gt;&lt;a href=&quot;http://docs.postach.io/embed-codes#youtube&quot; target=&quot;_blank&quot;&gt;Learn more about embedding youtube&lt;/a&gt;&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;</content>
  </entry>
  <entry xml:base="http://writings.miguelregedor.com/feed.xml">
    <title type="text">Hello world</title>
    <id>http://writings.miguelregedor.com/post/hello-world</id>
    <updated>2015-03-05T08:16:11.759000Z</updated>
    <published>2007-10-08T23:50:00Z</published>
    <link href="http://writings.miguelregedor.com/post/hello-world" />
    <author>
      <name>Miguel Regedor</name>
    </author>
    <category term="portugues" />
    <content type="html">&lt;p&gt;Pronto é este o meu primeiro post!&lt;/p&gt;
&lt;p&gt;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 protegidos com a bolha actimel!&lt;/p&gt;
&lt;p&gt;Deixo-vos com esta musica cuja letra se encontra muito bem conseguida! &lt;div class=&quot;container-embed&quot;&gt;
  &lt;div class=&quot;embed-inner&quot;&gt;
    &lt;div class=&quot;embed-left&quot;&gt;
      &lt;div class=&quot;embed-illustration nut-sad&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;embed-right&quot;&gt;
      &lt;span class=&quot;embed-title&quot;&gt;Uh oh, it looks like your embed code is broken.&lt;/span&gt;
      &lt;br /&gt;
      &lt;span class=&quot;embed-name&quot;&gt;&lt;a href=&quot;http://docs.postach.io/embed-codes#youtube&quot; target=&quot;_blank&quot;&gt;Learn more about embedding youtube&lt;/a&gt;&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;</content>
  </entry>
</feed>
