Es gibt zwei Möglichkeiten die Sprache für das Text- und Absatzformat in InDesign zu ändern. Wenn wir allerdings nicht für jedes Textfeld die Sprache ändern wollen, müssen wir uns eines Workarounds bedienen. Schließlich gibt es kein “Sprache für Dokument ändern”. Dann wollen wir mal:
(more…)
Archive for the ‘Gemachtes’ Category
InDesign: Sprache für ganzes Dokument ändern
Monday, March 8th, 2010Cheatsheet: moving data from one server to another
Wednesday, January 20th, 2010This article is about moving a running web-environment along with it’s MySQL database from one server to another via SSH.
Compress files
Let’s compress the directory we’re going to move using gzip:
tar cfvz backup.tar.gz /path/
Dump MySQL database content
mysqldump -uUser -p -hlocalhost database_name > dump.sql
You can also dump several databases with mysqldump by addind the --databases or --all-databases parameter.
Moving files
Now we use SCP to move files to our new machine. The following example copies from the old machine:
scp user@host:/path/backup.tar.gz .
The other way round, copying the file to the new machine from the old one would look like this:
scp backup.tar.gz user@host:/path/backup.tar.gz
Do the same with your database dump.
Uncompress files
Simply type:
tar xfvz backup.tar.gzNow we should have the same directory structure we had on our old machine.
Import MySQL database
mysql -uUser --default-character-set=utf8 -hlocalhost -p database_name < dump.sql
If you have international content and an utf-8 environment running don’t forget to pass the charset-parameter!
Hamburger Hafen im Winter
Tuesday, January 12th, 2010Passend zum Schneechaos in Norddeutschland ein paar Eindrücke aus dem Hamburger Hafen im Winter. Ich habe noch nichts nachbearbeitet – also seht ihr Rohmaterial aus der Kamera.
select any HTML text in element with jQuery
Thursday, November 19th, 2009The following script jQuery extension selects any text from a given jQuery selector. Tested with Firefox and Safari – should work in IE6+ as well.
jQuery.fn.extend({ selectText: function() { var text = $(this)[0]; if ($.browser.msie) { var range = document.body.createTextRange(); range.moveToElementText(text); range.select(); } else if ($.browser.mozilla || $.browser.opera) { var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(text); selection.removeAllRanges(); selection.addRange(range); } else if ($.browser.safari) { var selection = window.getSelection(); selection.setBaseAndExtent(text, 0, text, 1); } return $(this); } })
To use it simly do:
var shortSelector = $('#name').selectText(); var longSelector = $('ul#names li:contains("Hampel")').selectText();
HTML to PDF Library for PHP 5
Wednesday, July 8th, 2009
As I had to build a simple html to pdf converting for a client using php, I found a beautiful library called DOMPDF written by Benj Carson.
It seemed to be very lightweight and uncomplicated, which turned out to be true. In a standard case it really is as simple as
$pdf->load_html($html);
I am going to talk about the basic usage and problems I had to solve, specially with umlauts / non latin characters.
(more…)
Bankenrückblick, Giroüberblick
Thursday, June 18th, 2009
Nachdem ich mich nun seit einem Jahr mit den verschiedenen Banken auseinandersetzte und seit Amerika auch den Auslandseinsatz beurteilen kann, möchte ich die Erfahrungen nicht für mich behalten:
(more…)
Magento with top Navigation only
Friday, May 8th, 2009Again I had to learn how much magento e-commerce documentation sucks or better to say the lack of it. After reading several tutorials and part-conclusions, i found following working solution
First of all it’s important to have one default category as a root category. Then you can use the following code in “magento/app/design/frontend/<#your template#>/<#your layout#>/template/catalog/navigation/top.phtml”.
<div id="navi"> <ul> <?php foreach ($this->getStoreCategories() as $key => $cat): if ($this->isCategoryActive($cat)) { echo '<li class="active"> <a href="'.$this->getCategoryUrl($cat).'"> <span>'.$cat->getName()."</span></a> </li>\n"; } else { echo '<li class="normal"> <a href="'.$this->getCategoryUrl($cat).'"> <span>'.$cat->getName()."</span></a> </li>\n"; } endforeach; ?> </ul> </div>
Be sure to use $this->isCategoryActive() instead of finding out the current category first and compare it with the active one. This wouldn’t work for sub-categories so that an active sub-category wouldn’t mark it’s parent active. Actually many tutorials seem to have that mistake in their code.
A more or less good resource for magento developers is magetips.com.
I found the adressed function there as well.
jQuery and stopPropagation
Monday, January 12th, 2009Often you might not even notice the following problem: Imagine you got a table row or a list element including several links. By default you defined a function like
$('table tr').click(function(event) { target = $(this).find('a:first').attr('href'); open(target, '_self'); })
In this case the function finds the first defined link in our row and links it to the row itself.
If we click on the link, we get redirected to the defined target. But as the link is lying in our linked row, this click will also be executed and our target is loaded twice. Even though the user won’t notice it, functions like deleting or answering will throw errors.
jQuery got a very nice core function to suppress the second loading.
We are using this function to stop the propagation of our click-event like shown:
$('table tr').click(function(event) { target = $(this).find('a:first').attr('href'); open(target, '_self'); }) $('table tr a').click(function(event) { event.stopPropagation(); })
It reminds me of a “return false;”. Just look for the bind function here:
jQuery API Browser. There you may find more details on similiar cases, too.
UPDATE for Internet Explorer
As this won’t work in MS’ IE, you have to use the similar
event.cancelBubble = true;
(Source)
If you put both behind each other, IE would still throw some errors. So you should try following if-function if you are using jQuery:
agent = jQuery.browser; if(agent.msie) { event.cancelBubble = true; } else { event.stopPropagation(); }
Coda zur Webentwicklung und Twilight Theme
Tuesday, November 18th, 2008Seit kurzem ist Panics Coda auf dem Markt – ein Editor (und mehr), der sich konkret an Webentwickler richtet und durch einen eingebauten SVN- sowie FTP-Client glänzt. Ferner integriert er die Möglichkeit des direkten Zusammenarbeits am gleichen Code über Bonjour. Außerdem verfügt er über ab und an recht sinnvolle Syntaxvervollständigungen. Natürlich beherrscht er auch die Standard Features wie Syntax Highlighting, einen integrierten File-Browser und Projectmanagement, und so weiter.
Wichtig, was nun in der aktuellen Version hinzugefügt wurde, ist meiner Meinung nach das so genannte “Open Quickly” was man als TextMate benutzer unter dem Namen “Go to File” kennt. Mir persönlich hat dies immer sehr geholfen Files auch in großen Projekten zu finden. Seit dem dieses Feature zum Leistungsumfang gehört bin ich nun auch freudiger Coda-Nutzer und habe dem lange nicht wirklich upgedateten TextMate den Rücken gekehrt.
Leider ist die Community um Coda noch nicht so groß wie die TextMate’s und so findet sich wenig Material zum anpassen des grässlichen Coda Themes. Für alle die das selbe Problem haben, wie ich es hatte, habe ich meine Files zum Anpassen des Syntax-Highlightings für PHP, HTML, CSS und JS einmal als Zip angehängt.
Es ist ein beruhigender Twilight-Theme:
Download Coda Theme “pex Twilight”
TalentRun startet heute
Monday, December 17th, 2007Mein neuestes Projekt in Sachen Frontend Entwicklung für die Firma TalentRun GmbH in Hamburg neigt sich seinem Ende und ist heute als Beta für Freunde und Tester auf talentrun.de online gegangen.
Aktuelle Infos findet Ihr zum Beispiel im Videointerview mit Gruenderszene.de auf Sevenload oder in der letzten Pressemeldung der GEMA
Wer die Plattform testen möchte, kann sich natürlich gern melden und seine Freischaltung beschleunigen.
Anbei noch eine kleine Beschreibung der Grundidee der Karaoke-Plattform..
(more…)

