Skip to content

Instantly share code, notes, and snippets.

View DavidHernandez's full-sized avatar
📎

David Hernández DavidHernandez

📎
View GitHub Profile
@DavidHernandez
DavidHernandez / gist:859cbacdce8f2e892b67
Created November 28, 2014 12:45
render a node with comments when the $node item is not available in the path
<?php
/**
* If you want to emulate the node/%node page in a page without the $node in the path
* you can just call the same page callback as that url: node_page_view($node);
*/
$node = node_load($nid);
return node_page_view($node);
@DavidHernandez
DavidHernandez / fix_permissions.sh
Created November 13, 2014 13:14
Fix Drupal permissions
// Replace [data] with correct data.
sudo chown [user]:www-data [buildpath] -R
sudo chmod u-x,g-x [buildpath] -R
sudo chmod u=rwX,g=rX,o= [buildpath] -R
sudo chmod 2770 [files]
sudo chown www-data:www-data [files] -R
sudo chmod u=rwX,g=rwX,o= [files] -R
@DavidHernandez
DavidHernandez / script
Created September 22, 2014 10:40
A little script to install some Drupal tables. It could be a drush command, but I'm feeling lazy...
<?php
// Module name
$module = '';
// List of tables to install
$tables = array('');
$schemas = drupal_get_schema_unprocessed($module);
foreach ($schemas as $key => $schema) {