Vim: Switch Between Tests (Or Other Files)

As probably the most people, I am annoyed with repeating stuff over and over. And today I was annoyed about my workflow about switching between files. So I wrote a little vim function, that switches between unit tests and their corresponding counterparts under test and vice versa and creates them if nonexistant.
Continue Reading

3 votes, 4.33 avg. rating (88% score)

Git: Automated Merge Function (Bash/Zsh)

I have noticed, that I had a permanently repeating git workflow:

  1. Do some stuff and commit
  2. Checkout some deployed branch (i.e. ‘staging’)
  3. Update this branch (I am working in a team so this branch is also updated by other people)
  4. Merge my feature branch into staging branch
  5. Push staging branch
  6. Switch back to my feature branch

Continue Reading

3 votes, 3.33 avg. rating (73% score)

Linux – auto sync directories and files – setup in less than 5 minutes

If you are a webdeveloper using linux, you probably know this exhausting procedure:

You change a file, save it, and then you have to upload the changed file to the matching directory on your test web server in your favourite ftp program, i.e. FileZilla. You do this hundred times a day, thousand times a week.

On Windows, there is a program called WinSCP, a FTP client, that gets rid of this time consuming practice by offering an autosynchronization function for a specific directory after saving/modifying a file in this directory.

To immediately scale down your expectations: there is no linux GUI equivalent of WinSCP that has its built-in auto sync feature. But we have the shell. And we have built-in tools like rsync. And we have people like Gregg Hernandez, who create nifty little tools like watcher.

In this article I’ll show you how you can combine these two Tools to get a powerful auto synchronization setup in less than 5 minutes.

Continue Reading

5 votes, 5.00 avg. rating (99% score)

Vim PHP Refactoring: Extract Method Funktion

Mit Vim PHP refaktorisieren? Kein Problem mit folgender Funktion, das im Visual Mode markierten Code auslagert. Das Skript ist noch nicht ganz perfekt, aber schon mal eine ganz gute Basis. Im Laufe der nächsten Woche arbeite ich weiter daran. Die Basis für die Funktion ist eine C#-Variante von Klaus Horsten.


Du möchtest im folgenden Code Zeile 6-8 in eine eigene Funktion auslagern:

Continue Reading

3 votes, 5.00 avg. rating (98% score)

Ubuntu: Mit UEFI Von USB – WTF? RTFM!

Er ist da, mein neuer, mobiler Rechenhengst: das Lenovo ThinkPad Edge e330. Mit UEFI. Hat mich einige Nerven gekostet, weil ich dachte, ich kann mit der lange Jahre bewährten Methode einfach Windows 8 von der Platte putzen. Und Linux installieren. Denkste.

Continue Reading

4 votes, 4.75 avg. rating (95% score)

PHP: Debug Snippet Trotz Allowed Memory Size Exhausted

Wer beim Debuggen mit var_dump() oder debug_backtrace() von PHP Code folgenden Fehler bekommt:
PHP Fatal error: Allowed memory size of xxxxxxx bytes exhausted (tried to allocate xxxxxx bytes) in /mein/pfad/zur/script/datei.php on line xx

der versucht wahrscheinlich, ein Objekt aus einer riesigen Aggregation zu debuggen.

Continue Reading

2 votes, 5.00 avg. rating (98% score)