This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanString( str ) { | |
var from = "ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç ", | |
to = "AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuunncc_", | |
mapping = {}; | |
for(var i = 0, j = from.length; i < j; i++ ) | |
mapping[ from.charAt( i ) ] = to.charAt( i ); | |
var ret = []; | |
str = str.toLowerCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
video { width: 400px; height: auto; } | |
h2 { background: red; margin: 0; } | |
.video2 { display: block; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('ELEMENT').waypoint( function(direction) { | |
if (direction == 'down') { | |
console.log($(this).attr('id'), 'disappears top'); | |
} else { | |
console.log($(this).attr('id'), 'appears top'); | |
} | |
}, { offset: function(){ | |
return -$(this).height(); | |
}, triggerOnce: true, continuous: true}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// _-______Basic translatable string_______________________________ | |
<?php print t('STRING !VARIABLE1 @VARIABLE2 %VARIABLE3', array( | |
'@VARIABLE2' => 'VALUE ESCAPED & FORMATED', | |
'%VARIABLE3' => 'VALUE ESCAPED', | |
'!VARIABLE1' => 'VALUE AS IS', | |
)); ?> | |
// _-______string translatable with link_______ | |
// _-______Basic link_______________________________ | |
<?php print l(t('TEXT'), 'URL', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = db_select('node', 'n'); | |
$query ->condition('n.type', 'NODETYPE', '='); | |
$query ->condition('n.status', '1', '='); | |
$query->join('SOMEFIELDTABLE', 'l', 'n.nid = l.entity_id'); | |
$query->fields('n', array('title', 'nid')); | |
$query->fields('l', array('FIELDCOLUMNNAME')); | |
$query->orderBy('n.title'); | |
$result = $query->execute(); | |
foreach ($result as $record) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.validator.addMethod("dniCheck", function(value, element) { | |
if(/^([0-9]{8})*[a-zA-Z]+$/.test(value)){ | |
var numero = value.substr(0,value.length-1); | |
var let = value.substr(value.length-1,1).toUpperCase(); | |
numero = numero % 23; | |
var letra='TRWAGMYFPDXBNJZSQVHLCKET'; | |
letra = letra.substring(numero,numero+1); | |
if (letra==let) return true; | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://code.jquery.com/jquery-1.11.3.js"></script> | |
<script src="./script.js"></script> | |
<link rel="stylesheet" href="./style.css"> | |
<div class="bg_blue"> | |
<div class="butt butt-orange"><i class="icon-cart"></i>añadir a la cesta</div> | |
<br/><br/> | |
<div class="butt ">add to cart</div> | |
<br/><br/> | |
<div class="butt butt-orange butt-big">Checkout</div> | |
<br/><br/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// _-______defining menu elements_______________________________ | |
// (Including tpl theme) | |
/** | |
* Implements hook_menu(). | |
*/ | |
function MODULE_menu() { | |
$items['URL PATH'] = array( | |
'title' => 'TITLE', | |
'page callback' => 'CALLBACK FUNCTION', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* enlaces externos | |
^= indica que queremos dar estilo a aquellos enlaces que comiencen por http:// | |
*/ | |
a[href^="http://"]{ | |
padding-right: 20px; | |
background: url(external.gif) no-repeat center right; | |
} | |
/* emails | |
^= indica que queremos dar estilo a aquellos enlaces que comiencen con mailto: | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drush vset cache 0 | |
drush vset preprocess_css 0 | |
drush vset preprocess_js 0 |
NewerOlder