Skip to content

Instantly share code, notes, and snippets.

@reli
reli / printing_blocks
Created December 12, 2013 14:27
Blocks block render
<?php
Printing the blocks
/* Print custom block content */
$block = module_invoke('block','block_view','1');
print render($block['content']);
/* Print the whole custom block (with divs, title etc.) */
$block = block_load('block','1');
print drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
@reli
reli / patch_apply_remove
Last active November 9, 2018 12:03
Drupal patch Reversing patches
apply
patch -p1 < path/file.patch
remove
patch -p1 -R < path/file.patch
@reli
reli / general.js
Created November 23, 2013 17:23
jQuery
(function ($) {
$(document).ready(function(){
});
})(jQuery);
(function ($) {
}
@reli
reli / 0_reuse_code.js
Created November 23, 2013 17:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console