This file contains 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
REcopilacion de consultas SQL para drupal. | |
<?php | |
// Retorna un simple valor, retorna el nomnbre de la taxonomia | |
function termName($tid){ | |
$name = db_query("select name from {taxonomy_term_data} where tid=:tid", | |
array(':tid' => $tid))->fetchField(); | |
return $name; | |
} |
This file contains 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 | |
function THEMENAME_preprocess_page(&$variables, $hook) { | |
// Theming page--NODETYPE.tpl.php | |
if (isset($variables['node'])) { | |
$variables['theme_hook_suggestions'][] = 'page__' . $variables['node'] -> type; | |
} | |
/*Template sugestion for vocabulary NAME (String)*/ | |
/*Ex: page--vocabulary--VOCABULARYNAME.tpl.php*/ |
This file contains 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
jQuery(window).load(function () { | |
// console.log(jQuery.cookie("scrollTop")); | |
setTimeout(function () { | |
jQuery('body').trigger('resize'); | |
}, 200); | |
if ('referrer' in document && typeof document.referrer != undefined) { | |
var url_parts = document.referrer.split("/"); | |
var url = url_parts[0] + "//" + url_parts[2]; |
This file contains 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 | |
function user_agents(){ | |
$devices = array('iphone', 'android', 'ipad', 'iphone', 'blackberry'); | |
foreach ($devices as $ua) { | |
$tsuac[] = (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), strtolower($ua))) ? 1 : 0; | |
} | |
return (in_array(1, $tsuac)) ? '.sftouchscreen()' : ''; | |
} | |
?> | |
<html> |
This file contains 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
" Pathogen | |
filetype off " Pathogen needs to run before plugin indent on | |
call pathogen#runtime_append_all_bundles() | |
call pathogen#helptags() " generate helptags for everything in 'runtimepath' | |
filetype plugin indent on | |
filetype plugin on | |
set autoindent | |
set cmdheight=1 "command bar is 2 high | |
set backspace=indent,eol,start "set backspace function |
This file contains 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 | |
/** | |
* Theme_menu_tree doesn't provide any context information | |
* THIS SUCKS | |
* But you can use hook_block_view_alter to change the theme wrapper | |
* OUF! | |
*/ | |
function MYTHEME_menu_tree(&$variables) { |
This file contains 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 type="text/javascript"><!-- | |
google_ad_client = "ca-pub-3658299045266116"; | |
/* top */ | |
if ($(window).width()<728 ){ | |
google_ad_slot = "4414183254"; | |
google_ad_width = 320; | |
google_ad_height = 50; | |
}else{ | |
google_ad_slot = "1020377061"; | |
google_ad_width = 728; |
This file contains 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 | |
define("SECOND", 1); | |
define("MINUTE", 60 * SECOND); | |
define("HOUR", 60 * MINUTE); | |
define("DAY", 24 * HOUR); | |
define("MONTH", 30 * DAY); | |
/** | |
* Humanize by delta. | |
* |
This file contains 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
### | |
# Este Script sube fotos a tu album de Picasa web. | |
# Uso : python uploader.py -l <directorio> | |
### | |
import gdata.photos.service | |
import gdata.media | |
import gdata.geo | |
import os |
This file contains 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
# Recursively add a .gitignore file to all directories | |
# in the working directory which are empty and don't | |
# start with a dot. Helpful for tracking empty dirs | |
# in a git repository. | |
find . -type d -regex ``./[^.].*'' -empty -exec touch {}"/.gitignore" \; |