First of all, create the script
# Command line
# Install sshpass and screen previously (apt-get install sshpass screen)
nano ssh_tunnel.sh
Paste into this file
First of all, create the script
# Command line
# Install sshpass and screen previously (apt-get install sshpass screen)
nano ssh_tunnel.sh
Paste into this file
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
por
require( dirname( __FILE__ ) . '/wordpress-new/wp-blog-header.php' );
<?php | |
/** | |
* Implements hook_form_BASE_FORM_ID_alter(). | |
* | |
* Delete publish form field ONLY on create nody type page | |
*/ | |
function MYMODULE_form_node_form_alter(&$form, $form_state) { | |
if (isset($form['#node'])) { | |
$node = $form['#node']; |
window.ParsleyConfig = window.ParsleyConfig || {}; | |
(function ($) { | |
window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, { | |
validators: { | |
es_dni: function () { | |
return { | |
validate: function ( val, elem, self ) { | |
var letter, letters, number; |
# Taxonomy terms: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
# Menu links: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
# File items: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
# Nodes: |
LOCAL_LISTEN_ADDR=192.168.99.100: | |
HOST_PATH_HTTPD_DATADIR=~/Sites/www | |
HOST_PATH_MYSQL_DATADIR=~/Sites/mariadb | |
HOST_PATH_PGSQL_DATADIR=~/Sites/pgsql | |
HOST_PATH_MONGO_DATADIR=~/Sites/mongo |
<?php | |
/** | |
* Implements hook_drush_command(). | |
*/ | |
function MYMODULE_drush_command() { | |
$commands['mymodule-entity-list'] = [ |
# force delete | |
brew uninstall --force node | |
# change node_modules permission | |
sudo chown -R ${USER} /usr/local/lib/node_modules | |
# delete old node_modules (it's creepy, I know, but it's necessary) | |
rm -rf /usr/local/lib/node_modules | |
# free a lot of memory | |
brew cleanup | |
# install node and gpm | |
brew install node |
composer create-project drupal/drupal drupal_folder_example | |
cd drupal_folder_example | |
drush si --db-url=mysql://root:root@localhost/drupal_folder_example | |
drush upwd admin --password="easypassword" | |
composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader |
#Drupal 8 snippets
##Create absolute URL:
$options = ['absolute' => TRUE];
$url_object = Drupal\Core\Url::fromRoute('entity.node.canonical', ['node' => $nid], $options);
// will output http://example.com/path-to-my-node
##Create absolute link object (and inner span):