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 | |
/** | |
* Implements hook_block_info | |
*/ | |
function custom_module_block_info() { | |
$blocks['custom_module_my_block'] = array( | |
'info' => t('My block'), | |
'cache' => DRUPAL_CACHE_PER_PAGE, | |
); |
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 | |
// hook_block_info | |
/** | |
* Our block specific code | |
*/ | |
function custom_module_block_view($delta = '') { | |
if ($delta == ''){ | |
// current node |
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
#!/bin/bash | |
IP=`curl -s http://whatismyip.org/` | |
echo $IP |
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 | |
function my_module_form($form, &$form_state) { | |
$form['sample_field'] = array( | |
'#type' => 'checkboxes' | |
'#title' => 'Sample', | |
'#options' => array('test' => 'Test') | |
); | |
$form['select_box'] = array( |
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
#!/bin/bash | |
# | |
# Move the feature tar file contents into your site and remove it | |
# | |
# Usage: | |
# move_feature.sh [feature file] [drupal directory] | |
# | |
# |
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
#!/usr/bin/env python | |
""" | |
workTime.py | |
Coded by: Rob Ballou ([email protected]) | |
Calculates the number of hours that have passed | |
in a work day (starting at 8:30). | |
The start time can be changed by passing the hour and min |
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
// remove the ajax-processed class from the element so that | |
// attachBehaviors() will update the element | |
$('#my-element-id').removeClass('ajax-processed'); | |
// now re-attach the behaviors to this element | |
Drupal.attachBehaviors($('#my-element-id')); |
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
<div class="container"> | |
<div class="section-header"><h3>Header</h3></div> | |
<div class="section-item">...</div> | |
<div class="section-item">...</div> | |
<div class="section-item">...</div> | |
<div class="section-header"><h3>Header</h3></div> | |
<div class="section-item">...</div> | |
<div class="section-item">...</div> |
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($){ | |
$(document).ready(function(){ | |
$('.section-header').each(function(){ | |
var $this = $(this); | |
// use .add() and .nextUntil() to get both the .section-header | |
// and .section-item elements into a single set for our .wrapAll() call | |
$this.add($this.nextUntil('.section-header', '.section-item')) | |
.wrapAll('<div class="section-container"></div>'); |
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($){ | |
$(document).ready(function(){ }); | |
})(jQuery); |