Skip to content

Instantly share code, notes, and snippets.

John Dillick jdillick

Block or report user

Report or block jdillick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jdillick
jdillick / unlock-mac-system-preferences-pane.md
Last active Mar 2, 2016
Unlock a Mac System Preferences Pane
View unlock-mac-system-preferences-pane.md

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
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
<?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
jdillick / .gitconfig
Created Jan 8, 2015
Create local branch from Stash Pull-Request
View .gitconfig
[alias]
prstash = "!f() { git fetch $1 refs/pull-requests/$2/from:$3; } ; f"
@jdillick
jdillick / generate-strongarms.php
Last active Aug 29, 2015
Drush script to generate strongarm variables module for a site
View generate-strongarms.php
<?php
$args = drush_get_arguments();
if ( ! isset($args[2]) ) {
drush_set_error('Usage: drush @<alias> scr generate-strongarm.php <module_name> <base_path>');
exit();
}
$module_name = $args[2];
if ( ! isset($args[3]) ) {
@jdillick
jdillick / makefile-parse.php
Created Jan 27, 2014
drush script for parsing makefiles
View makefile-parse.php
<?php
$stuff = make_parse_info_file('makefiles/highlights.make');
print_r($stuff);
@jdillick
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
<?php
// the current environment
$env = $_ENV['ENVTYPE'] ? $_ENV['ENVTYPE'] : '';
// paths to search for drupal sites
$paths = array(
'/var/www/multisites/',
'/var/www/schoolyard/',
);
@jdillick
jdillick / find_closest_sha1.py
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.
View find_closest_sha1.py
#!/usr/bin/env python
import subprocess
import shlex
import sys
import os
import operator
gitdir,workdir=map(os.path.realpath,sys.argv[1:3])
os.chdir(gitdir)
proc=subprocess.Popen(shlex.split('git rev-list --all'),stdout=subprocess.PIPE)
You can’t perform that action at this time.