Skip to content

Instantly share code, notes, and snippets.


John Dillick jdillick

View GitHub Profile
jdillick /
Last active Mar 2, 2016
Unlock a Mac System Preferences Pane

Unlock Pesky System Preference Pane Lockdown

Note, you're local mac account must have sudo privs for this to work. If you're in the same boat I'm in, there is some piece of management software (e.g. casper) installed on your system that removes access to system preference panes when you login (to a domain).

In my case, the "Security and Privacy" pane was removed by a network admin for I'm sure they believed to be very important reasons, but this prevents me from using my window management tool (BetterSnapTool).

On to the steps

In this example, I'm unlocking the "Security and Privacy" pane. You will need to substitue your locked panes plist below.

jdillick / makefile-parse.php
Created Jan 27, 2014
drush script for parsing makefiles
View makefile-parse.php
$stuff = make_parse_info_file('makefiles/highlights.make');
jdillick / aliases.drushrc.php
Last active Dec 24, 2015
Dynamic drush aliases. Just modify $paths to include the directory to your drupal installs, and you have instant aliases.
View aliases.drushrc.php
// the current environment
$env = $_ENV['ENVTYPE'] ? $_ENV['ENVTYPE'] : '';
// paths to search for drupal sites
$paths = array(
jdillick /
Created Jan 17, 2013
Found this little gem of python for comparing a git repo to an un-versioned copy of the code. I returns the closest commit hash from the git repository corresponding to your code. This works great when you don't know what version of the code you have running.
#!/usr/bin/env python
import subprocess
import shlex
import sys
import os
import operator
proc=subprocess.Popen(shlex.split('git rev-list --all'),stdout=subprocess.PIPE)
jdillick / fix-image-location.php
Created Jun 9, 2015
Migrates Drupal managed image to new directory specified in the field instance settings. Takes argument entity and bundle containing the image field.
View fix-image-location.php
$args = drush_get_arguments();
$entities = array();
$entity_info = entity_get_info();
foreach ($entity_info as $name => $info) {
$entities[$name] = array_keys($info['bundles']);
jdillick / .gitconfig
Created Jan 8, 2015
Create local branch from Stash Pull-Request
View .gitconfig
prstash = "!f() { git fetch $1 refs/pull-requests/$2/from:$3; } ; f"
jdillick / generate-strongarms.php
Last active Aug 29, 2015
Drush script to generate strongarm variables module for a site
View generate-strongarms.php
$args = drush_get_arguments();
if ( ! isset($args[2]) ) {
drush_set_error('Usage: drush @<alias> scr generate-strongarm.php <module_name> <base_path>');
$module_name = $args[2];
if ( ! isset($args[3]) ) {
You can’t perform that action at this time.