https://es.wikipedia.org/wiki/Lista_de_entidades_de_ayuda_al_desarrollo
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 | |
Class ServiceContainer { | |
public $services; | |
private $container; | |
public static function get($service) { | |
$container = ServiceContainer::getContainer(); | |
return $container->services[$service]; |
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 | |
$file = system_retrieve_file($remote_file_url); | |
$node->field_image[$node->language][] = (array) $file; | |
node_save($node); |
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 | |
/** | |
* @file | |
* | |
* This super small module adds a page that creates an order with a product | |
* and redirects to the payment platform. | |
* | |
* It can be used as sample or base for simple commerce workflows. It | |
* doesn't need to be a menu item, can be done in a form submit callback. |
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 | |
/** | |
* @file | |
* Contains Singleton. | |
*/ | |
/** | |
* Singleton that gets saved into a global variable. | |
*/ |
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
#!/usr/bin/php | |
<?php | |
/** | |
* This script receives two colors and the number of steps | |
* of the progress and returns the different color for each | |
* step. | |
*/ |
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/sh | |
PROJECT = $1 | |
tmux new-session -d -s $PROJECT | |
tmux new-window -t $PROJECT:1 -n 'Logs' ; | |
tmux split-window -h ; | |
tmux select-pane -L | |
tmux send-keys -t $PROJECT:1 'sudo tail -f /var/log/apache2/error.log' C-m |
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 | |
/** | |
* 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); |
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
// 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 |
NewerOlder