Skip to main content

Posts

I'm sorry it's German, but it's just too funny: "Diese Vermarktungsstrategie ist hochgradig sexistisch, wer jetzt meint, er könne sich endlich auch mal an einen Roman wagen und "Fucking Karlsruhe: Bekenntnisse eines deutschen Maschinenbaustudenten" verfassen, wird es schwer haben, einen Verlag zu finden." ( spiegel.de )

I wish I'd have more time reading

Weekend Reading: Ruby Best Practice Chapter 1, Driving Code Through Tests Yes, I'm a little behind with my reading, but it was definitely worth while. I was happy to find such a good chapter on testing, because most other books only cover trivial testing, but they don't show how to build useful tests. What did I learn? * use single tests for every different case. This results in better readability, and in case an assertion fails, I know exactly in which scenario it failed and all assertions in different tests, will be tried, so I'll know right away if all of them failed or just a particular one * use tests more as a way to drive your software, not only as regression tests * there's a when ? Yes, switch-case is a case-when in Ruby * goal for next time Ruby programming: force myself to use a stub/mock * embedding tests in library files For my math programming (Macaulay2) I rely heavily on tests: for every little function a handful of tests, and a few functi...

Screen for long remote tasks

use to start a session named mySession on your remote machine. Start the things you want to run, for example a close the shell by quitting terminal (don't Ctrl C out!) When you come back, and want to see how far your make went, attach to the old screen with If you don't remember what you called the session, try

Working here

Now I know where I want to work, it's just a matter of working hard enough to get there.

Git pushing to multiple repositories

If for some reason you have to push to multiple repositories, add an alias to your .git/config (obviously you don't want this in your ~/.gitconfig): The exclamation mark runs the alias as a command, without an exclamation mark, it's assumed that you run a git command. results in a change in your ~/.gitconfig which you can delete with or delete all aliases.

Vim for irb

Ever used irb and wished you had safed your commands or could edit them using Vi? Ever tried something new in irb, and then had to painfully copy and paste it to the .rb file? Slime.vim from Jonathan Palardy will be your new best friend. Slime.vim lets you send highlighted text to a different terminal. This means you can write a few commands, send them to a terminal running irb, notice you want to change something in your first command, modify that line in Vi and resend it to irb, and so on. Put slime.vim into ~/.vim/plugins In one terminal : 1. start a named screen 2. name the window You'll be prompted for the window's name, "Set window's title to:" irb_window 3. start irb In a different terminal , start vi and type irb commands, highlight one or multiple commands (ESC V to highlight the current line, ESC vip to highlight a paragraph), type C-c C-c to execute the highlighted text in the other terminal. The first time you'll be prompted for se...