vim and the Ubuntu clipboard

Two of my friends have recently become vim fanatics. I played with vim a little before, but now I’ve made it my primary editor.

One thing that bugged me was that, by default, you are not able to copy text from vim into other applications in Ubuntu. To fix this, you just need to do:

sudo apt-get install vim-gnome

Then, you can visually select a block of text and yank it to the clipboard using the "+y command.

To paste the contents of the clipboard into vim, you would use the "+p command.

Source: http://ubuntuforums.org/showthread.php?t=106262

Baseline Checker Bookmarklet

Update: For your forking pleasure, check out the github repository.

If you’re a web designer, you’re probably familiar with the typographical concept of “baseline rhythm“.

While tackeling the problem on this site, all I could find was baseline rhytm calculators. Sure, that helps a little, but it wasn’t quite what I needed. So I wrote this bookmarklet, creatively named “Baseline Checker”.

screenshot

What it does

It draws equally spaced horizontal lines on top of a webpage. The position and the distance between the lines is calculated in reference to a particular element on that page.

With it, you can see for yourself if the baseline is consistent or not.

How to use it

  1. “Install” the bookmarklet by dragging ( Baseline Checker ) to your bookmarks menu.
  2. Go to a webpage and then click the bookmarklet.
  3. Click an element on the page.

Icon credit: Sam Rayner

PS: You might also want to look at jMetronome.

Link-uri fără diacritice în WordPress

Update: Acest defect a fost în sfârșit rezolvat și nu ar trebui să mai facă probleme în WordPress 3.1 (care ar trebui să apară prin decembrie, 2010).

Mi-ar place ca toate lucrurile să meargă, pur și simplu. Din păcate, asta nu se întâmplă aproape niciodată, mai ales când vine vorba de diacritice și mai ales dacă ne uităm la diacriticele românești.

Deoarece URL-urile cu diacritice cauzează diferite problem în motoarele de căutare și nu numai, WordPress le convertește automat.

Din păcate, literele ‘ț’ și ‘ș’ nu sunt convertite în ‘t’, respectiv ‘s’.

Există însă o soluție destul de simplă: În fișierul functions.php al temei de WordPress folosite de tine, adaugă următoarele linii de cod:

add_filter('wp_insert_post_data', 'caractere_problema');
function caractere_problema($data) {
	if ( empty($data['post_name']) )
		$name = $data['post_title'];
	else
		$name = $data['post_name'];
 
	$rep = array(
		'%c8%9b' => 't',
		'%c8%99' => 's',
		urldecode('%c8%9b') => 't',
		urldecode('%c8%99') => 's',
	);
 
	$new_name = str_replace(
		array_keys($rep),
		array_values($rep),
		$name
	);
 
	if ( $new_name == $name )
		return $data;
 
	$data['post_name'] = $new_name;
	return $data;
}

Asta e tot.