Browsed by
Month: February 2013

Ruby 2.0 lançado! O que há de novo?

Ruby 2.0 lançado! O que há de novo?

ruby2

A versão 2.0 do Ruby foi lançada há dois dias.

Eu pensei em escrever um post listando e comentando cada uma das novas features, alterações, melhorias e incompatibilidades (quase nenhuma, felizmente) da linguagem. Mas acabei encontrando dois posts muito bons que fazem exatamente isso. O primeiro utilizando exemplos de códigos e o segundo são os slides do Urabe Shyouhe. Então, não deixe de ler:

http://blog.marc-andre.ca/2013/02/23/ruby-2-by-example/
https://speakerdeck.com/shyouhei/whats-new-in-ruby-2-dot-0

Hellо, I am a compiler

Hellо, I am a compiler

robot

I copied this little text from a comment on the Stackoverflow website. I really enjoyed it ;)

Hellо, I am a compiler.
I just scanned thousands of lines of code while you were reading this sentence. I browsed through millions of possibilities of optimizing a single line of yours using hundreds of different optimization techniques based on a vast amount of academic research that you would spend years getting at. I won’t feel any embarrassment, not even a slight ick, when I convert a three-line loop to thousands of instructions just to make it faster. I have no shame to go to great lengths of optimization or to do the dirtiest tricks. And if you don’t want me to, maybe for a day or two, I’ll behave and do it the way you like. I can transform the methods I’m using whenever you want, without even changing a single line of your code. I can even show you how your code would look in assembly, on different processor architectures and different operating systems and in different assembly conventions if you’d like. Yes, all in seconds. Because, you know, I can; and you know, you can’t.

P.S. Oh, by the way you weren’t using half of the code you wrote. I did you a favor and threw it away.

Getting root permissions on a file inside of Vim

Getting root permissions on a file inside of Vim

Sometimes you open a file that you need root permissions to save it.
When it happen, you can close and reopen the Vim (with sudo) or you also can do:

:w !sudo tee %

Thanks to @dlisboa for the tip.

Vim Users BR

Vim Users BR

No mês passado, eu criei um grupo de discussões para usuários do editor Vim.

A idéia por trás da criação do grupo é que os usuários pudessem se envolver, compartilhar e discutir coisas interessantes relacionadas à esse fantástico editor. Comentar uma dica nova, um plugin interessante ou alguma técnica útil que pouca gente conheça, etc…

Segue o link do grupo:
https://groups.google.com/forum/?fromgroups=#!forum/vim-users-br