Skip to content

Instantly share code, notes, and snippets.

@discipolo
discipolo / docker-compose-ci.yml
Created October 27, 2017 05:05
drupal ci docker compose
version: "2.0"
volumes:
db_data:
services:
# Web
web:
hostname: web
---
# test SSH agent forwarding
- shell: echo "Client= [$SSH_CLIENT] Sock= [$SSH_AUTH_SOCK]"
sudo: no
register: myecho
- debug: msg="{{myecho.stdout}}"
- shell: ssh-add -l
sudo: no
register: myecho
- debug: msg="{{myecho.stdout}}"
http://www.w3schools.com/json/tryit.asp?filename=tryjson_function
<?php
/**
* @Then /^(?:|I )should see the following in the repeated "(?P<element>[^"]*)" element within the context of the "(?P<parentElement>[^"]*)" element
*/
public function assertRepeatedElementContainsText(TableNode $table, $element, $parentElement)
{
$parent = $this->getSession()->getPage()->findAll('css', $parentElement);
foreach ($table->getHash() as $n => $repeatedElement) {
$child = $parent[$n];
@discipolo
discipolo / ShowFolderTree.py
Created October 31, 2015 17:22
stateful directory list
#!/usr/bin/python
import os
import sys
tree = []
def main(argv):
# extract path to an attachment directory (remove *.txt extension)
path = argv[1]
# -*- coding: utf-8 -*-
#
# treemapeditor.py
#
# This is a plugin for Zim, which creates treeMap graph based on tabbed keywords.
# Initial version comes from the following source: http://blog.ynema.com/?p=192
#
#
# Author: NorfCran <norfcran@gmail.com>
# Date: 2015-07-09
#!/usr/bin/python
## This custom tool helps to create mindmap like diagrams
# the main core algorithm comes from http://blog.ynema.com/?p=192
# adapted to suit the ZIM structure and some additional improvement of nodes (like a formating feature)
# write page with content corresponding to the webpage http://www.text2mindmap.com/
# it automatically creates a png file in the same folder as a source text (page) => has to be inserted to the page manually
# the source text (page) corresponds to a page title (it allows few mindmaps per page)
@discipolo
discipolo / gist:56eef33b8fccd5e4830d
Created April 23, 2015 22:19
remove unused modules in a Drupal site with the help of Drush
unused=$(drush pm-list --no-core --pipe --type=module --status='not installed' | awk '{print "\x27" $1 "\x27" }' | tr "\n" ",") && drush sqlq "SELECT name, filename from system WHERE name IN (${unused%?});" > unused-modules.txt