Skip to content

Instantly share code, notes, and snippets.

View philoSurfer's full-sized avatar

Mariano Crivello philoSurfer

  • Pantheon
  • Koloa, HI
View GitHub Profile
drush php-eval ' global $timers; $hook = 'cron'; $return = array(); $args = array(); foreach (module_implements($hook) as $module) { $function = $module . '_' . $hook; print($function ." - "); timer_start($function); $result = call_user_func_array($function, $args); if (isset($result) && is_array($result)) { $return = array_merge_recursive($return, $result); } else if (isset($result)) { $return[] = $result; } timer_stop($function); print($timers[$function]['time'] ."\r\n"); }'
#!/usr/bin/python
import os
import sys
import argparse
def parse_args():
p = argparse.ArgumentParser()
p.add_argument('--dryrun', '-n', action='store_true')
p.add_argument('search')
@philoSurfer
philoSurfer / gulpfile.js
Last active April 24, 2020 21:16
drupal/zurb_foundation/STARTER/ gulp 4 work
(() => {
'use strict';
/**************** Gulp.js 4 configuration ****************/
const
// development or production
devBuild = ((process.env.NODE_ENV || 'development').trim().toLowerCase() === 'development'),
@philoSurfer
philoSurfer / .gitattributes
Created March 11, 2020 22:45
.gitattributes for Drupal
# Drupal git normalization
# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# @see https://www.drupal.org/node/1542048
# Normally these settings would be done with macro attributes for improved
# readability and easier maintenance. However macros can only be defined at the
# repository root directory. Drupal avoids making any assumptions about where it
# is installed.
# Define text file attributes.
@philoSurfer
philoSurfer / landoSmash.sh
Created March 19, 2020 20:09
Lando smasher for MacOS
#!/bin/sh
# file: landoSmash.sh
echo "LANDO SMASH!!!";
# change to your project folder
cd ~/clones/presence;
# exports db if it is bootstrappable (word?)
echo "Exporting dB...\n";
@philoSurfer
philoSurfer / multisite-lando-config.yml
Created September 30, 2021 19:43 — forked from kyletaylored/multisite-lando-config.yml
Lando WordPress Network Site / Multisite (WPMS)
# Using the pantheon recipe / wordpress_network framework, we add a config to the
# appserver_nginx service to use our own server and vhost files. Copy the files lando
# uses and on the wordpress_network.conf.tpl and added wp/ to the rewrite
# rules so lando knows where our WP files live within our Bedrock setup.
appserver_nginx:
type: nginx
ssl: true
config:
server: 'private/config/lando/nginx.conf.tpl'
@philoSurfer
philoSurfer / .lando.yml
Created April 6, 2023 07:30 — forked from MatthieuScarset/.lando.yml
Correct settings for XDebug + VSCode + Lando (+3.0)
# Lando version is at least +3.0
name: drupal-nine
recipe: drupal9
services:
appserver:
webroot: web
xdebug: debug
config:
php: .vscode/php.ini
## once Ubuntu 22.04 is installed :
sudo apt update;
sudo apt install php8.1 php-xml php-curl composer;
## Then once those are installed:
mkdir -p ~/terminus && cd ~/terminus;
curl -L https://github.com/pantheon-systems/terminus/releases/download/3.1.5/terminus.phar --output terminus;
chmod +x terminus;