Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
@keopx
keopx / phpunit_wrap.php
Last active October 26, 2015 19:17 — forked from dawehner/gist:1fc1683b1212cae1ee66
wrap phpunit with the needed env vars
<?php
function phpunit --description "wrap phpunit with the needed env vars"
set -g -x SIMPLETEST_DB 'mysql://root@localhost/dev_d8'
set -g -x SIMPLETEST_BASE_URL 'http://d8.dev'
command phpunit $argv
end

Download DrupalConsole

curl -LSs http://drupalconsole.com/installer | php

Make DrupalConsole globaly accesible

mv console.phar /usr/local/bin/drupal
@keopx
keopx / install_mysql.sh
Last active September 15, 2015 17:34 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@keopx
keopx / mymodule.php
Last active August 29, 2015 14:27 — forked from juampynr/mymodule.php
Database update with Batch API template
<?php
/**
* @file mymodule.install
* Install hooks for mymodule.
*/
/**
* Description of what the database update does. Do not use "Implements..." since it adds
* zero information and makes reading the list of pending database updates in Drush harder
* to read.
@keopx
keopx / symfony-drupal.md
Last active August 29, 2015 14:27 — forked from jmolivas/symfony-drupal.md
Drupal related tools based on modern PHP development and Symfony components
<?php
$file = system_retrieve_file($remote_file_url);
$node->field_image[$node->language][] = (array) $file;
node_save($node);
#!/bin/bash
docker stop `docker ps -aq`
docker rm `docker ps -aq`
docker rmi `docker images -aq`
<?php
/**
* Implement of drush_hook_COMMAND_validate().
*
* Prevent catastrophic sql-sync to live. Note that this file has to be local to the
* machine that intitiates sql-sync command.
*/
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
if (strstr($destination, '.prod')) {
@keopx
keopx / checklist.md
Last active August 29, 2015 14:07 — forked from juampynr/checklist.md