Skip to content

Instantly share code, notes, and snippets.

Avatar

Benji Fisher benjifisher

  • Boston area
View GitHub Profile
@benjifisher
benjifisher / lando status one-liner with jq
Last active Oct 29, 2019
Get status information from `lando list` and `jq`
View lando status one-liner with jq
lando list --format json | jq 'map_values(.[0].status)'
@benjifisher
benjifisher / updateandcommit.sh
Created Dec 17, 2015
Update a Drupal extension (module or theme) and commit to git with this shell script.
View updateandcommit.sh
#!/bin/bash
echo Update a Drupal extension and commit the result to git.
echo Warning: alpha version. Assumes you are in sites/all/modules/contrib or similar.
read -e -p 'Which extension? ' EXT
if [ -z "$DRUSH_ALIAS" ]; then
read -e -p 'Site alias (include "@"): ' ALIAS
else
ALIAS=$DRUSH_ALIAS
echo "Site alias: $ALIAS"
@benjifisher
benjifisher / vdebug.vim
Created May 15, 2015
A bit of Vdebug configuration.
View vdebug.vim
" Configuration for the Vdebug interface to Xdebug (and DBGp) debugger.
" See :help Vdebug and https://github.com/joonty/vdebug.
if !exists('g:vdebug_options')
let g:vdebug_options = {}
endif
if !exists('g:vdebug_options.path_maps')
let g:vdebug_options.path_maps = {}
endif
let g:vdebug_options['path_maps']['/var/www/drupal'] = '/Users/bfisher/Sites/drupal-7.32/'
@benjifisher
benjifisher / ansible.snippets
Created Nov 16, 2014
Work in progress: Ansible snippets for use with vim SnipMate or Ultisnips plugins.
View ansible.snippets
snippet azure
azure:
name=${1}
location=${2}
subscription_id=${3}
management_cert_path=${4}
storage_account=${5}
image=${6}
role_size=${7}
endpoints=${8}
@benjifisher
benjifisher / find_commit.php
Created Nov 6, 2013
This php command-line script will do a binary search to find the first git commit that breaks your patch. It will give simple usage instructions if you invoke it without arguments. I wrote this script to help in re-rolling patches for Drupal. I posted the original version as a comment on https://drupal.org/patch/reroll . The script makes a reaso…
View find_commit.php
#!/usr/bin/env php
<?php
// Get the arguments. If there are not two, then print usage info.
if (count($argv) != 3) {
$scriptname = basename($argv[0]);
print("Usage: $scriptname <date> <patchfile>" . PHP_EOL);
print('where <date> is any date understood by git' . PHP_EOL);
print('and <patchfile> applied cleanly on <date>, not today.' . PHP_EOL);
print("Example: $scriptname 2013/05/17 foo.patch" . PHP_EOL);
You can’t perform that action at this time.