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($) { | |
// updates the ... | |
$.ajax({ | |
url: "/my_module/update/" + Drupal.settings.my_module_node.nid, | |
type: "POST", | |
dataTypeString: "text" | |
}); | |
})(jQuery); |
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
/** | |
* Implements field_group_build_pre_render_alter. | |
*/ | |
function iniciativas_field_group_build_pre_render_alter(&$element) { | |
if (!isset($element['#view_mode']) && isset($element['group_edit_datos_basicos'])) { | |
$element['group_edit_datos_basicos'] += array( | |
'#states' => array( | |
'visible' => array( | |
'#edit-field-iniciativa-tipo-und' => array('value' => 'individual'), | |
), |
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
; Source http://www.thingy-ma-jig.co.uk/blog/10-10-2006/mysql-drop-all-tables | |
mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE] |
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
# with Entity API | |
$user = user_load('uidXXX'); | |
$obj = entity_metadata_wrapper('user', $user); | |
$obj->field_XXX = 'blah'; | |
$obj->save(); | |
# Other way | |
$existing = user_load('uidXXX'); |
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
Linux or Unix find and remove files with one find command on fly | |
find . -name "FILE-TO-FIND"-exec rm -rf {} \; | |
find . -type f -name "FILE-TO-FIND" -exec rm -f {} \; | |
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
/** | |
* Implements hook_block_info(). | |
* | |
* This hook declares what blocks are provided by the module. | |
*/ | |
function stock_block_info() { | |
$blocks['cart_quantity'] = array( | |
'info' => t('Cart Quantiy'), | |
'status' => 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
@charset "UTF-8"; | |
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video { | |
margin: 0; | |
padding: 0; | |
border: 0; |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
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
/* CSS States */ | |
body { | |
background: url(http://dabblet.com/img/noise.png); | |
background-color: #F5F2F0; | |
font-family: Georgia, serif; | |
font-size: 18px; | |
line-height: 1.6em; | |
text-shadow: 0 2px 0 white; | |
color: #222; | |
} |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |