Skip to content

Instantly share code, notes, and snippets.


keopx keopx

View GitHub Profile
# Purge all Varnish cache
varnishadm "ban req.url ~ /"
keopx / langoliers.rb
Created Mar 28, 2017 — forked from robinsloan/langoliers.rb
Tweet delete script
View langoliers.rb
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from
CONSUMER_KEY = "your_consumer_key"
keopx / template.tpl.php
Created Nov 23, 2016 — forked from gagarine/template.tpl.php
Working with drupal theme_menu_tree
View template.tpl.php
* Theme_menu_tree doesn't provide any context information
* But you can use hook_block_view_alter to change the theme wrapper
* OUF!
function MYTHEME_menu_tree(&$variables) {
keopx /
Created Nov 13, 2016 — forked from skwashd/
DrupalCon Dublin: Let the Machines do the Work
keopx /
Created Nov 13, 2016 — forked from skwashd/
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 / Using_pool.txt Example of appending requests on the fly using an ArrayIterator as generator and comparing that approach to $event->retry() and $client->send()
View Using_pool.txt
php bin/phpspec run
keopx /
Created Oct 26, 2015 — forked from mortendk/
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 / phpunit_wrap.php
Last active Oct 26, 2015 — forked from dawehner/gist:1fc1683b1212cae1ee66
wrap phpunit with the needed env vars
View phpunit_wrap.php
function phpunit --description "wrap phpunit with the needed env vars"
set -g -x SIMPLETEST_DB 'mysql://root@localhost/dev_d8'
command phpunit $argv

Download DrupalConsole

curl -LSs | php

Make DrupalConsole globaly accesible

mv console.phar /usr/local/bin/drupal