Llistes ul multicolumna amb jQuery

Interessant plugin que trenca les llistes ul/ol en vàries columnes

http://archive.plugins.jquery.com/node/4786

http://codeasily.com/jquery/multi-column-list-with-jquery

Posted in Desclassificat | Tagged , | Leave a comment

Usar Jquery 1.4 / 1.5 a Drupal 6

Drupal 6 ve per defecte amb JQuery 1.2, en un projecte he necessitat usar Jquery 1.4 com a mínim, i si substitueixes el fitxer hi ha coses de la interfície d’administració que deixen de funcionar. Per resoldre-ho, cal fer que el sistema carregui versions diferents de Jquery segons on es trobi:

Modifiquem el mòdul jquery_update


function jquery_update_jquery_path() {    
    $curr_uri = request_uri();
     if (strpos($curr_uri,'admin')>0 || strpos($curr_uri,'edit')>0 || strpos($curr_uri,'add')>0){
        $jquery_file = array('none' => 'jquery.js', 'min' => 'jquery.min.js');
        return JQUERY_UPDATE_REPLACE_PATH .'/'. $jquery_file[variable_get('jquery_update_compression_type', 'min')]
;
    }
    else {
        $jquery_file = array('none' => 'jquery-1.5.2.js', 'min' => 'jquery-1.5.2.min.js');
        return JQUERY_UPDATE_REPLACE_PATH .'/'. $jquery_file[variable_get('jquery_update_compression_type', 'min')]
;
    }
}

http://drupal.org/node/775924#comment-2987316

http://stackoverflow.com/questions/5874880/drupal-6-and-jquery-1-4-1-5

 

Posted in Drupal | Tagged , | Leave a comment

Usar un theme per les views (D6 Views2)

Si volem ussar fitxers tpl per personalitzar les views i necessitem saber les variables de que disposem:

http://views-help.doc.logrus.com/help/views/using-theme

<?php drupal_set_message('<pre>' . var_export($row, true) . '</pre>'); ?>

Només cal posar això al tpl i ens mostrarà les variables com a missatge de Drupal. Llavors per posar una d’aquestes variables al theme fem això

<?php print $fields['some_id']->content; ?>

 

 

 

Posted in Drupal | Tagged , , , | Leave a comment

Millorar rendiment d’Eclipse a OSX

http://www.kineticklink.com/speeding-up-eclipse-on-os-x-leopard/

eclipse.ini

) which contols the minimum and maximum size of the heap.  If you’re using a OS X based Eclipse you’ll find this file by showing the content of Eclipse.app by right clicking

(Ctrl+click)

on the file and selecting show package contents.  The file is located in

Contents/MacOs/

.

Look for the following lines:

-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
Xms

and

Xmx

set the minimum and maximum heap size.

The XX:MaxPermSize

is a bit confusing, but one thing it can affect is Garbage collection.  The part of the heap that

MaxPermSize

defines is where classes and methods are kept and if it fills, it can trigger a full garbage collection.   I found some discussion online about what this setting means for memory usage and how different versions of Java apply these settings diffently. Base on my cursory exploration, you can be safe by using this formula to determine the maximum memory Eclipse will use:

Xmx + XX:MaxPermSize

This all in mind, I set mine at:

-Xms256m
-Xmx512m
-XX:MaxPermSize=256m
Posted in Internet i noves tecnologies | Tagged | Leave a comment

Crossbrowser javascript history.back

http://just-another-coder.blogspot.com/2009/08/javascript-historygo-cross-browser-back.html

<a href="#" onclick="if(document.referrer)  {window.open(document.referrer,'_self');} else {history.go(-1);} return  false;">link</a>
Posted in Desclassificat | Tagged | Leave a comment

Alineació vertical dins un DIV

http://phrogz.net/css/vertical-align/index.html

<div style="display:table-cell; vertical-align:middle"> ... </div>

Method 1

The following example makes two (non-trivial) assumptions. If you can meet these assumptions, then this method is for you:
  • You can put the content that you want to center inside a block and specify a fixed height for that inner content block.
  • It's alright to absolutely-position this content. (Usually fine, since the parent element inside which the content is centered can still be in flow.
If you can accept the above necessities, the solution is:
  1. Specify the parent container as position:relative or position:absolute.
  2. Specify a fixed height on the child container.
  3. Set position:absolute and top:50% on the child container to move the top down to the middle of the parent.
  4. Set margin-top:-yy where yy is half the height of the child container to offset the item up.
An example of this in code:
<style type="text/css">
	#myoutercontainer { position:relative }
	#myinnercontainer { position:absolute; top:50%; height:10em; margin-top:-5em }
</style>
...
<div id="myoutercontainer">
	<div id="myinnercontainer">
		<p>Hey look! I'm vertically centered!</p>
		<p>How sweet is this?!</p>
	</div>
</div>


 

 

Posted in Desclassificat | Tagged | Leave a comment

Mostrat títol d’un node a una view en fer mouseover a una imatge

Només cal fer un rewrite de la sortida i afegir el títol que hem carregat prèviament.

http://drupal.stackexchange.com/questions/4959/how-to-show-node-title-when-mouseover-on-image-in-the-node-by-drupal-views

I don’t think you can do that using views. However you can “hack” a way to add title element to a div, for instance.

go to your view config page

add a node: title field.

edit the node: title field.

tick “Exclude from display” and “strip HTML tags”

click save

move the title node to top of the fields.

edit your image field and tick “Rewrite the output of this field”

a textarea appears. write this code in the textarea

<div title="[title]">[image]</span>

Note: the [fields] are tokens. If you already have a title field, you don’t need to exlude it, you can re-use it.

if the image displays another title its because the module automatically sets a title tag to the image. You can either change this tag with javascript:

document.getElementById("idElement").setAttribute("Title", "title");

or edit your image module and set the page title to be your title tag.

 

Posted in Drupal | Tagged , , | Leave a comment

Activar còpies de OSX Time Machine a la xarxa

Per defecte TimeMachine només permet fer còpies a unitat de disc connectades directament. Per poder fer-les a una unitat de xarxa cal escriure això a un terminal:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Font: http://www.engadget.com/2007/11/10/how-to-enable-time-machine-on-unsupported-volumes/

Posted in Internet i noves tecnologies | Tagged , | Leave a comment

Cafè al Fresco acompanyant un bon amic que acaba de ser pare

image

Posted in Cafès | Leave a comment

Cafè amb gel al centre

image

Posted in Cafès | Leave a comment