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
function pj_preprocess_node(&$variables) { | |
//change ['pjtest'] to name of the variable you're creating | |
$variables['pjtest'] = 'PJ is Testing'; | |
} |
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
$('.getMyHTMLTag')[0].tagName; | |
//returns 'P' |
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
#!/bin/bash | |
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default). | |
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic. | |
# Required variables: | |
RSS_URI="/rss" | |
MAIL_TO="your@email.com" | |
LOG_FILE="/var/log/httpd/access_log" |
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 | |
ini_set('display_errors', 1); | |
error_reporting(E_ALL); | |
?> |
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
$(document).ready(function() { | |
if ($.browser.msie) { | |
var browserType = $.browser; | |
//change 7.0 in the line below to 6.0, 8.0, 9.0, etc, depending on targeted version | |
if (browserType.version == 7.0) { | |
//do stuff | |
} | |
} | |
}); |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond $1 !^(index\.php|css|img|js|fonts|robots\.txt) | |
RewriteRule ^(.*)$ index.php/$1 [L] | |
</IfModule> |
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
$('#div').has('.other-div').length; | |
//returns 1 if it does, returns 0 if it doesn't |
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
$findTheFileURL = file_create_url($node->field_csv_file['und'][0]['uri']); |
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
//Your region won't be rendered if it doesn't have a zone. There is a work-around for your use-case. All the //regions that are not being printed get placed in $page['#excluded']. You can use hook_page_alter() to move a //region from there to the part of the $page array that gets forwarded to the templates. | |
//source: http://drupal.org/node/1200272 | |
$page['my_new_region'] = $page['#excluded']['my_new_region']; |
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
$(window).load(function(){ | |
var height = jQuery('#your-element').outerHeight(true); | |
$('#your-element').css('height',mainContainerVXDHeight); | |
}) |