Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
@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
@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 / 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"

Download DrupalConsole

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

Make DrupalConsole globaly accesible

mv console.phar /usr/local/bin/drupal
@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
@keopx
keopx / template-choser.md
Created October 26, 2015 19:45 — forked from mortendk/template-choser.md
Drupal8 concept for selecting templates form the ui

template chooser

Drupal8 is pretty awesome, but its a problem that you cant choose fromt the ui which template to use. Sure you can overwrite whats there (node--article.html.twig) but that dont give the end user a chance to later change in the site & can end up in even more templates & clutter.

template suggestions

Make it easy to provide a template suggestion for entities, blocks, pages, nodes, fields, menues, username, everything that have a template you should be able to give a suggestion.

class selector

A prepopulated list of classes that can be selected for a template.

The modules userbase is sitebuilders & themes that wants to provide variations for a site, developers dont have to provide templates after a site is build, and can rely on the theme to provide all the variations.

@keopx
keopx / phpstormdebug.sh
Created November 4, 2015 08:07
PHPSTORM debug
#!/bin/sh
export XDEBUG_CONFIG="idekey=PHPSTORM"
php bin/phpspec run
@keopx
keopx / Using_pool.txt
Last active February 9, 2016 11:13 — forked from paslandau/guzzle-append-requests-on-the-fly-generator-vs-retry.php
Example of appending requests on the fly using an ArrayIterator as generator and comparing that approach to $event->retry() and $client->send()
http://stackoverflow.com/questions/28105093/incrementally-add-requests-to-a-guzzle-5-0-pool-rolling-requests
https://github.com/guzzle/guzzle/issues/946
http://docs.guzzlephp.org/en/latest/quickstart.html#concurrent-requests
@keopx
keopx / README.md
Created November 13, 2016 10:17 — forked from skwashd/README.md
Drupal git pre-commit hook

This pre-commit hook is designed to be used for Drupal 7 and 8 sites.

Download the pre-commit file. Save it as .git/hook/pre-commit in your git repo. You need to ensure that the file is executable.

If you want this to be added to all new projects automatically, add it to your git init templates.

To install and PHP CodeSniffer for Drupal, please read the official documentation.

To see this working checking out this short YouTube video.

@keopx
keopx / resources.md
Created November 13, 2016 10:18 — forked from skwashd/resources.md
DrupalCon Dublin: Let the Machines do the Work