Skip to content

Instantly share code, notes, and snippets.

@pcambra
pcambra / feeds_file_field_collection.php
Last active November 20, 2015 11:00
File field feeds - field collection https://www.drupal.org/node/1063434
/**
* Implements hook_feeds_processor_targets_alter().
*
* Overrides the file.inc mapping to correctly set the allowed extensions for
* files inside field collections.
*/
function {my_module}_feeds_processor_targets_alter(array &$targets, $entity_type, $bundle) {
if ($bundle == 'field_files_collection') {
foreach ($targets as $target_id => &$target) {
@pcambra
pcambra / check-mandatory-fields.php
Last active October 14, 2015 13:22
Look for empty mandatory fields
<?php
/**
* Implements hook_menu().
*/
function {my_module}_menu() {
$items = array();
$items['check-mandatory-fields'] = array(
'title' => 'Mandatory content missing',
@pcambra
pcambra / boot2docker-nfs.rb
Last active August 29, 2015 14:27 — forked from mattes/boot2docker-nfs.rb
docker-machine/ boot2docker with NFS instead of vboxsf
#!/usr/bin/env ruby
# Usage
# $ docker-machine create my-machine123 -d virtualbox
# $ ruby <(curl -L https://git.io/vvvco) my-machine123
# https://gist.github.com/mattes/4d7f435d759ca2581347
require 'erb'
bootlocalsh = %Q(#/bin/bash
{
"name": "mynamespace/myproject",
"description": "Composer file example",
"repositories": [
{
"type": "composer",
"url": "http://drupal-packagist.webflo.io/"
},
{
"type": "package",
{
"name": "mynamespace/myproject",
"description": "Example composer file with provides",
"repositories": [
{
"type": "composer",
"url": "http://drupal-packagist.webflo.io/"
},
{
"type": "package",
<?php
use Drupal\Core\Config\Schema\SchemaCheckTrait;
/**
* Implements hook_drush_command().
*/
function ef_drush_command() {
$items['schema-validate'] = [
'description' => dt('Validates all config schemaj'),
];
### Keybase proof
I hereby claim:
* I am pcambra on github.
* I am pcambra (https://keybase.io/pcambra) on keybase.
* I have a public key whose fingerprint is 2227 2DE6 2288 E442 9F53 E7D4 419D F417 CA48 27F8
To claim this, I am signing this object:
limit maxproc 512 1024
limit maxfiles 1024 2048
limit maxfiles 8192 20480
limit maxproc 1000 2000
limit maxfiles 20480 30480
limit maxproc 1000 2000
<target name="behat" description="Run Scenario with Behat" depends="load-properties, setup-dirs, clean">
<property name="behat.basedir" value="${project.basedir}/tests/behat"/>
<exec executable="behat">
<arg line=" --config='${behat.basedir}/behat.yml' --profile='ci' --format='junit' --out='${project.logdir}/behat' ${behat.basedir}/features" />
</exec>
</target>
#!/bin/bash
function drupal-install() {
sudo rm -rf sites/default;
sudo git checkout -- sites/default;
sudo chmod -R 777 sites/default;
sudo chown -R `whoami` sites/default;
sudo git checkout -- sites/default;
sudo chown -R `whoami` sites/default;
#exit;