Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
#!/bin/bash
sudo rm -fr /
@keopx
keopx / current_theme.php
Created April 4, 2016 09:40
Drupal 7 - Current theme
<?php
$current_theme = variable_get('theme_default','none');
$themes = list_themes();
$theme_object = $themes[$current_theme];
// print all the object fields
dsm($theme_object);
?>
@keopx
keopx / stop_remove_docker_all.md
Last active February 12, 2017 13:40
Stop / remove all Docker containers

Stop all Docker containers

docker stop $(docker ps -a -q)

Remove not running all containers

docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm
@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
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
@keopx
keopx / Vagrant_nfs_debian8.sh
Last active December 10, 2015 16:00
Vagrant NFS in Debian 8
sudo su
modprobe nfsd
# https://bugzilla.mozilla.org/show_bug.cgi?id=1056049#c8
systemctl stop nfs-kernel-server.service
systemctl disable nfs-kernel-server.service
systemctl enable nfs-kernel-server.service
systemctl start nfs-kernel-server.service
@keopx
keopx / Create_bootable_usb.sh
Created November 20, 2015 08:14
Create bootable usb | Ubuntu 15.10 amd64
sudo dd bs=4M if=/home/keopx/Escritorio/ubuntu-15.10-desktop-amd64.iso of=/dev/sdb && sync
@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 / 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 / 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