<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0" xml:base="https://www.thingy-ma-jig.co.uk/">
  <channel>
    <title>Thingy Ma jig - Drupal Geek Blog</title>
    <link>https://www.thingy-ma-jig.co.uk/</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Homebrew: List packages and what uses them</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/22-09-2014/homebrew-list-packages-and-what-uses-them</link>
  <description>
&lt;span&gt;Homebrew: List packages and what uses them&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/os-x" hreflang="en"&gt;OS X&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/homebrew" hreflang="en"&gt;Homebrew&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2014-09-22T21:26:49+01:00" title="Monday, September 22, 2014 - 21:26"&gt;Mon, 22/0926/2014 - 21:26&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;For anyone that uses &lt;a href="http://brew.sh"&gt;Homebrew&lt;/a&gt; a lot, its very easy to amasse many casks (installed packaged) and never quite know which ones are still needed. I did some googling and found a really interesting blog post by &lt;a href="http://twitter.com/zanshin"&gt;Mark H. Nichols&lt;/a&gt; about &lt;a href="http://zanshin.net/2014/02/03/how-to-list-brew-dependencies/"&gt;listing all brew dependencies&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I then decided to invert that logic; to list all my casks, with each one showing what uses it. Anything that has nothing using it is either an oprhaned cask or is something "standalone" which is not installed as a dependency on something else.&lt;/p&gt;

&lt;p&gt;NOTE: The script from Mark's website uses zsh; I do not have that, I use plain old Bash. It is still possible to get colours though!&lt;/p&gt;

&lt;pre&gt;
&lt;code class="language-bash"&gt;brew list -1 | while read cask; do echo -ne "\x1B[1;34m $cask \x1B[0m"; brew uses $cask --installed | awk '{printf(" %s ", $0)}'; echo ""; done&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And some example output:&lt;/p&gt;

&lt;pre class="language-plain"&gt;
 apple-gcc42 
 atk  gtk+  pygtk 
 autoconf  automake  php54-apc  php54-mcrypt  php54-memcache  php54-tidy  tsocks 
 automake 
 axel 
 bison27 
 boot2docker 
 cairo  gtk+  harfbuzz  pango  py2cairo 
 cmake  percona-server55 
...
...
&lt;/pre&gt;

&lt;p&gt;And a screenshot:&lt;br&gt;
&lt;img alt="Screenshot" data-entity-type data-entity-uuid height="697" src="https://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/images/homebrew-list-orphaned-dependencies.png" width="964"&gt;&lt;/p&gt;
&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=Homebrew%3A%20List%20packages%20and%20what%20uses%20them&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/22-09-2014/homebrew-list-packages-and-what-uses-them&amp;amp;2=node/427&amp;amp;3=a%3A0%3A%7B%7D" token="mrYPFmBOXFnRZzvUAdnaEpn9aI9Br05vU4_JOo2wxug"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Mon, 22 Sep 2014 20:26:49 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">427 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>Re-ordering the elements of a Drupal Webform Datepicker</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/04-06-2013/re-ordering-the-elements-of-a-drupal-webform-datepicker</link>
  <description>
&lt;span&gt;Re-ordering the elements of a Drupal Webform Datepicker&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/howto" hreflang="en"&gt;howto&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2013-06-04T10:46:22+01:00" title="Tuesday, June 4, 2013 - 10:46"&gt;Tue, 04/0646/2013 - 10:46&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;The Date Picker widget, when using webforms, defaultly appears in American form (Month, Day, Year). For UK sites this isn't often desirable. Doing a quick google and I stumbled upon &lt;a href="https://twitter.com/davidsonj" rel="author"&gt;James Davidson&lt;/a&gt;'s &lt;a href="http://davidsonj.com/blog/how-reorder-date-format-webform-date-picker"&gt;blog post on how to re-theme the element&lt;/a&gt; from earlier this year. I thought it was certainly one approach, but felt there must have been a neater alternative. So here is my approach:&lt;/p&gt;
&lt;!--break--&gt;

&lt;pre&gt;
&lt;code class="language-php"&gt;
/**
 * Implements hook_webform_component_render_alter().
 */
function THEMENAME_webform_component_render_alter(&amp;amp;$element, &amp;amp;$component) {
  if ($element['#type'] == 'date') {
    $element['#process'][] = 'THEMENAME_webform_expand_date';
  }
}

/**
 * Process function to re-order the elements in the date widget.
 */
function THEMENAME_webform_expand_date($element) {
  $element['day']['#weight'] = 0;
  $element['month']['#weight'] = 1;
  $element['year']['#weight'] = 2;
  return $element;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Obviously you can replace &lt;code&gt;THEMENAME&lt;/code&gt; with what ever theme or module name you like; in my case I put this in the &lt;code&gt;template.php&lt;/code&gt; file.&lt;/p&gt;
&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=Re-ordering%20the%20elements%20of%20a%20Drupal%20Webform%20Datepicker&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/04-06-2013/re-ordering-the-elements-of-a-drupal-webform-datepicker&amp;amp;2=node/426&amp;amp;3=a%3A0%3A%7B%7D" token="u26aLufXI9V-K6NxJHVc4IkdVbYMkJkOlJV9i6HK1m0"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Tue, 04 Jun 2013 09:46:22 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">426 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>Git: How to run a command on a specific folder</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/15-10-2012/git-how-to-run-a-command-on-a-specific-folder</link>
  <description>
&lt;span&gt;Git: How to run a command on a specific folder&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/git" hreflang="en"&gt;git&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/howto" hreflang="en"&gt;howto&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/tips" hreflang="en"&gt;tips&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2012-10-15T15:30:00+01:00" title="Monday, October 15, 2012 - 15:30"&gt;Mon, 15/1030/2012 - 15:30&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;I recently needed to be able to run a regular git task on a folder and I didn't want to have to &lt;a href="http://en.wikipedia.org/wiki/Cd_(command)" title="Change Directory"&gt;CD&lt;/a&gt; into that folder first. Annoyingly, there didn't seem to be an optional "path" parameter to &lt;code&gt;git remote update&lt;/code&gt;, until I looked at the help file for Git.&lt;/p&gt;
&lt;!--berak--&gt;
&lt;p&gt;It's quite simple! All you need to do, to run a git command on an arbitrary path, is this:&lt;/p&gt;
&lt;pre language="bash"&gt;
$ git --git-dir=/path/to/the/repository remote update
&lt;/pre&gt;
&lt;p&gt;This makes assigning, say, a cron job to regularly update repository which is being used by a tool such as &lt;a href="http://gitlist.org/" title="GitList - a great and free PHP-based git repository browser"&gt;GitList&lt;/a&gt;, very easy indeed!&lt;/p&gt;&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=Git%3A%20How%20to%20run%20a%20command%20on%20a%20specific%20folder&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/15-10-2012/git-how-to-run-a-command-on-a-specific-folder&amp;amp;2=node/425&amp;amp;3=a%3A0%3A%7B%7D" token="iAN2DvUNSyvhsx8jliCq0AYT17weeD3vzSuJJs--loA"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Mon, 15 Oct 2012 14:30:00 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">425 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>2D Terrain Maker</title>
  <link>https://www.thingy-ma-jig.co.uk/project/2d-terrain-maker</link>
  <description>
&lt;span&gt;2D Terrain Maker&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/dark-basic-pro" hreflang="en"&gt;dark basic pro&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2012-10-12T17:30:57+01:00" title="Friday, October 12, 2012 - 17:30"&gt;Fri, 12/1030/2012 - 17:30&lt;/time&gt;
&lt;/span&gt;
      &lt;div class="field field--name-field-sections field--type-entity-reference-revisions field--label-hidden field__items"&gt;
              &lt;div&gt;  &lt;div class="paragraph paragraph--type--text-section paragraph--view-mode--default"&gt;
                      &lt;h2 class="field field--name-field-title field--type-string field--label-hidden field__item"&gt;About&lt;/h2&gt;
                  &lt;div class="field field--name-field-body field--type-text-long field--label-hidden field__item"&gt;&lt;p&gt;This is a tool + engine for making a simple 2D terrain in Dark Basic Pro.&lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div&gt;  &lt;div class="paragraph paragraph--type--text-section paragraph--view-mode--default"&gt;
                      &lt;h2 class="field field--name-field-title field--type-string field--label-hidden field__item"&gt;Details&lt;/h2&gt;
                  &lt;div class="field field--name-field-body field--type-text-long field--label-hidden field__item"&gt;&lt;p&gt;I made this as an example for a forum topic.&lt;/p&gt;

&lt;p&gt;Basically, you have a map file with polygon (ie tile) count, tile sizes (width and depth) and then the data follows.&lt;/p&gt;

&lt;p&gt;The data is in the form of numbers representing tile type. You provide a tile template that is a 256x256 image with 32x32 tiles. This provides 64 tiles (0-63) numbered consecutively in rows.&lt;/p&gt;

&lt;p&gt;After the map is made, the game loads it and displays it and rotates around. Feel free to use this for a game if you like (you will need Dark Basic Pro).&lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div&gt;  &lt;div class="paragraph paragraph--type--text-section paragraph--view-mode--default"&gt;
                      &lt;h2 class="field field--name-field-title field--type-string field--label-hidden field__item"&gt;Instructions&lt;/h2&gt;
                  &lt;div class="field field--name-field-body field--type-text-long field--label-hidden field__item"&gt;&lt;p&gt;Make or edit the map!!&lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
    &lt;div class="field field--name-field-files field--type-file field--label-above"&gt;
    &lt;h2 class="field-title"&gt;Files&lt;/h2&gt;
          &lt;div&gt;
              &lt;div&gt;&lt;table data-striping="1"&gt;
  
  
      &lt;thead&gt;
      &lt;tr&gt;
                  &lt;th&gt;Attachment&lt;/th&gt;
                  &lt;th&gt;Size&lt;/th&gt;
              &lt;/tr&gt;
    &lt;/thead&gt;
  
      &lt;tbody&gt;
              &lt;tr&gt;
                      &lt;td&gt;&lt;span class="file file--mime-application-x-msdos-program file--general"&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/field_files/TexturedMapTerrain.sfx.exe" type="application/x-msdos-program"&gt;TexturedMapTerrain.sfx.exe&lt;/a&gt;&lt;/span&gt;
&lt;/td&gt;
                      &lt;td&gt;1.5 MB&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;tr&gt;
                      &lt;td&gt;&lt;span class="file file--mime-application-octet-stream file--general"&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/field_files/TexturedMapTerrain%20Project%20File.dbpro" type="application/octet-stream"&gt;TexturedMapTerrain Project File.dbpro&lt;/a&gt;&lt;/span&gt;
&lt;/td&gt;
                      &lt;td&gt;1.46 KB&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;tr&gt;
                      &lt;td&gt;&lt;span class="file file--mime-application-octet-stream file--general"&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/field_files/Source%20Code.dba" type="application/octet-stream"&gt;Source Code.dba&lt;/a&gt;&lt;/span&gt;
&lt;/td&gt;
                      &lt;td&gt;4.55 KB&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;tr&gt;
                      &lt;td&gt;&lt;span class="file file--mime-text-plain file--text"&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/field_files/map%20format.txt" type="text/plain"&gt;map format.txt&lt;/a&gt;&lt;/span&gt;
&lt;/td&gt;
                      &lt;td&gt;1.04 KB&lt;/td&gt;
                  &lt;/tr&gt;
          &lt;/tbody&gt;
    &lt;/table&gt;
&lt;/div&gt;
              &lt;/div&gt;
      &lt;/div&gt;
</description>
  <pubDate>Fri, 12 Oct 2012 16:30:57 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">424 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>How to remove Setaga from X-Notifier for Chrome</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/23-08-2012/how-to-remove-setaga-from-x-notifier-for-chrome</link>
  <description>
&lt;span&gt;How to remove Setaga from X-Notifier for Chrome&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/tips" hreflang="en"&gt;tips&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2012-08-23T11:00:16+01:00" title="Thursday, August 23, 2012 - 11:00"&gt;Thu, 23/0800/2012 - 11:00&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;I am a huge fan of the &lt;a href="https://chrome.google.com/webstore/detail/x-notifier-for-gmailhotma/cdfjbkbddpfnoplfhceolpopfoepleco"&gt;X Notifier extension for Chrome&lt;/a&gt;, however recently the developer has added an advertising component called &lt;a href="http://www.setaga.com/"&gt;Setaga&lt;/a&gt;. I don't recall agreeing or opt-ing into this, but its possible I did without thinking. In any case, I hate this and wanted to remove it.&lt;/p&gt;
&lt;!-- break --&gt;
&lt;p&gt;I found &lt;a href="http://xnotifier.tobwithu.com/wp/forums/topic/setaga" title="Segata Forum Post"&gt;a post on their forum&lt;/a&gt;, but could not see how to remove it. So I did it myself. Here's how:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Find the extension. For me (on Windows 7) it was in:&lt;br&gt;&lt;pre&gt;C:\Users\{USERNAME}\AppData\Local\Google\Chrome\User Data\Default\Extensions\apebebenniibdlpbookhgelaghfnaonp\1.0.12_0&lt;/pre&gt;. Note, that random text is the application ID. You also see it in the URL for the extension on the &lt;a href="https://chrome.google.com/webstore/category/home"&gt;Webstore site&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Next, open &lt;code&gt;manifest.json&lt;/code&gt; in something like Notepad++.&lt;/li&gt;
  &lt;li&gt;Lines 8-12 look like this. Remove them (ensuring the syntax of the json remains in-tact):&lt;pre language="js"&gt;
   "content_scripts": [ {
      "js": [ "content/setaga/inject.js" ],
      "matches": [ "http://*/*" ],
      "run_at": "document_start"
   } ],
&lt;/pre&gt;Save the file.&lt;/li&gt;
  &lt;li&gt;Go into the Content folder and delete the &lt;code&gt;segata&lt;/code&gt; folder.&lt;/li&gt;
  &lt;li&gt;Restart Chrome&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It's possible this "fix" may need to be reapplied when the addon updates. Hence me writing this. So I remember how to do it.&lt;/p&gt;&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=How%20to%20remove%20Setaga%20from%20X-Notifier%20for%20Chrome&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/23-08-2012/how-to-remove-setaga-from-x-notifier-for-chrome&amp;amp;2=node/423&amp;amp;3=a%3A0%3A%7B%7D" token="Q-xlT6IM7_kxGJDV_5II7FrooaL1pYxvTcVOf_eQ_3M"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Thu, 23 Aug 2012 10:00:16 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">423 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>How to run Drush as Apache</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/10-08-2012/how-to-run-drush-as-apache</link>
  <description>
&lt;span&gt;How to run Drush as Apache&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/linux" hreflang="en"&gt;linux&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2012-08-10T12:14:11+01:00" title="Friday, August 10, 2012 - 12:14"&gt;Fri, 10/0814/2012 - 12:14&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;It's usually considered &lt;em&gt;best practice&lt;/em&gt; to run Drush under the same user account that the webserver runs on. Some modules, such as XML Sitemap, Advanced Aggregator and cTools, often try to alter or generate files. If you run Drush under your own account then these files may get generated as you (and therefore become unwritable by the webserver) or, if the files were generated by the webserver, are usually unwritable by your user which can mean you get errors and being unable to delete/unlink files.&lt;/p&gt;
&lt;!-- break --&gt;

&lt;p&gt;The solution is to run Drush as your webuser, usually Apache. For example:&lt;/p&gt;

&lt;pre&gt;
&lt;code class="language-bash"&gt;su -s /bin/sh apache -c "/usr/bin/drush @sites cron -y"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This method also helps get around the problem/error &lt;code&gt;This account is currently not available&lt;/code&gt; by running drush under a shell executed as Apache. On most systems, the apache user is secured to not have a shell account associated with it.&lt;/p&gt;
&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=How%20to%20run%20Drush%20as%20Apache&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/10-08-2012/how-to-run-drush-as-apache&amp;amp;2=node/422&amp;amp;3=a%3A0%3A%7B%7D" token="vh1NyGsqR4cyuL9S_KhdtT5fmOjteQtez_Po8UMAzY4"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Fri, 10 Aug 2012 11:14:11 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">422 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>Forcing New Relic into Kiosk Mode</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/09-03-2012/forcing-new-relic-into-kiosk-mode</link>
  <description>
&lt;span&gt;Forcing New Relic into Kiosk Mode&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/new-relic" hreflang="en"&gt;New Relic&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/greasemonkey" hreflang="en"&gt;GreaseMonkey&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2012-03-09T15:05:31+00:00" title="Friday, March 9, 2012 - 15:05"&gt;Fri, 09/0305/2012 - 15:05&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;New Relic is a great bit of kit - nobody can deny that. I recently needed to configure it on a standalone box so it could be open on a large screen so my colleagues and I could see the current status of our sites. New Relic has a &lt;em&gt;Kiosk Mode&lt;/em&gt; which strips out some of the navigation from the page an optimises it for "viewing only". Very handy.&lt;/p&gt;
&lt;p&gt;I wanted a setting to force (or at least default) the page into Kiosk mode so that when I opened the bookmark on the browser, I didn't have to scroll to the bottom, click it, scroll back up and then refresh any other relevant tabs. It didn't look like there was a feature for this and the Kiosk Mode link was just a java function call; there was no URL.&lt;/p&gt;
&lt;p&gt;So I turned to GreaseMonkey.&lt;/p&gt;
&lt;!-- break --&gt;
&lt;h2&gt;Enter GreaseMonkey&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.greasespot.net/"&gt;GreaseMonkey&lt;/a&gt; is a &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/"&gt;Firefox Addon&lt;/a&gt; which allows you to bind custom JS scripts to all (or specific) pages. There is a &lt;a href="http://userscripts.org/"&gt;repository of over 74,000 scripts&lt;/a&gt; which let you customize all kinds of sites (Twitter, Gmail, Facebook, etc) including &lt;a href="http://userscripts.org/tags/drupal"&gt;Drupal&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However there was nothing for New Relic.&lt;/p&gt;
&lt;p&gt;Until now.&lt;/p&gt;
&lt;h2&gt;Using GreaseMonkey with New Relic&lt;/h2&gt;
&lt;p&gt;As it turns out, the script is &lt;strong&gt;very&lt;/strong&gt; simple.&lt;/p&gt;
&lt;pre language="javascript"&gt;
// ==UserScript==
// @name            New Relic Kiosk Mode
// @namespace       http://www.thingy-ma-jig.co.uk/
// @icon            http://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/greasemonkey/NewRelic_inline_small.png
// @description     Force New Relic into Kiosk mode by setting the cookie on page load if ?kiosk is in the URL
// @include         https://rpm.newrelic.com/*?kiosk
// @updateURL       http://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/greasemonkey/newrelic-kioskmode.user.js
// @version         1.0
// ==/UserScript==

unsafeWindow.RPM.kioskMode._setCookie();
&lt;/pre&gt;
&lt;p&gt;Once the cookie is set, New Relic handles the rest. All you need to do is append "&lt;code&gt;?kiosk&lt;/code&gt;" onto the URL (maybe in your bookmarks?) and the page loads in Kiosk mode.&lt;/p&gt;
&lt;p&gt;You can install the script by clicking on this button.&lt;/p&gt;
&lt;p style="text-align:center"&gt;&lt;a href="http://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/greasemonkey/newrelic-kioskmode.user.js" class="button blue bigbutton"&gt;Install Kiosk Mode Script&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Find It On UserScripts.org&lt;/h2&gt;
&lt;p&gt;I have also &lt;a href="http://userscripts.org/scripts/show/127956"&gt;added the script to UserScripts.org&lt;/a&gt;, for those that are interested.&lt;/p&gt;&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=Forcing%20New%20Relic%20into%20Kiosk%20Mode&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/09-03-2012/forcing-new-relic-into-kiosk-mode&amp;amp;2=node/420&amp;amp;3=a%3A0%3A%7B%7D" token="maF9jIxQsmzGaLcMzxHqoMfzJp8jahpKqVw1KCXk4i8"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Fri, 09 Mar 2012 15:05:31 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">420 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>Exporting a Git Repository</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/15-12-2011/exporting-a-git-repository</link>
  <description>
&lt;span&gt;Exporting a Git Repository&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/git" hreflang="en"&gt;git&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/webdev" hreflang="en"&gt;webdev&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2011-12-15T16:14:07+00:00" title="Thursday, December 15, 2011 - 16:14"&gt;Thu, 15/1214/2011 - 16:14&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;Have you ever needed or wanted to pull a remote Git Repository on Drupal.org down as a zip or tarball? You know, the way Github does? Most project releases have fairly recently built tarballs which is awesome - but Sandboxes do not (so it seems - please correct me if I'm wrong!).&lt;/p&gt;
&lt;p&gt;The following snippet lets you "archive" a remote repository, pull it down as a tarball, and extract it in-place:&lt;/p&gt;
&lt;pre language="bash"&gt;
git archive --format=tar --prefix=PROJECT/ --remote=USERNAME@git.drupal.org:sandbox/USERNAME/123456789.git BRANCH | tar -xf -
&lt;/pre&gt;
&lt;!--break--&gt;
&lt;p&gt;Some important notes:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The prefix is very important - without it, tar extracts to the current folder.&lt;/li&gt;
  &lt;li&gt;The trailing slash on the prefix is equally important - without it all files have PROJECT at the beginning!&lt;/li&gt;
  &lt;li&gt;The number (next to .git) references the sandbox Node ID.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have tried using the "zip" format, however the &lt;code&gt;unzip&lt;/code&gt; bash command doesn't accept &lt;code&gt;stdin&lt;/code&gt; as a source. It looks like &lt;code&gt;funzip&lt;/code&gt; might hold some promise thought…&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; - looks like you can only do this if your user has access to the repository.&lt;/p&gt;&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=Exporting%20a%20Git%20Repository&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/15-12-2011/exporting-a-git-repository&amp;amp;2=node/419&amp;amp;3=a%3A0%3A%7B%7D" token="kpAjDCIetKpk1NwrG7Rgn2RYYBabQxhuGcM1EufhwCc"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Thu, 15 Dec 2011 16:14:07 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">419 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>Quick Tip: Drupal Hook Commenting Using Vim</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/14-11-2011/quick-tip-drupal-hook-commenting-using-vim</link>
  <description>
&lt;span&gt;Quick Tip: Drupal Hook Commenting Using Vim&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/vim" hreflang="en"&gt;vim&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/programming" hreflang="en"&gt;programming&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2011-11-14T17:50:52+00:00" title="Monday, November 14, 2011 - 17:50"&gt;Mon, 14/1150/2011 - 17:50&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;According to the &lt;a href="http://drupal.org/node/1354#hookimpl"&gt;Drupal Coding Standards for Documenting Hook Implementations&lt;/a&gt;, its considered a good practice to quickly chuck a comment before any function which implements a Drupal hook (eg, &lt;code&gt;hook_menu&lt;/code&gt;). This helps someone reading your code quickly see that the function is actually linked with a hook in Drupal and isn't just a function in your module to be called directly.&lt;/p&gt;

&lt;p&gt;But… Well… The thing is… Does anyone else get bored of writing the following over and over again? I know do…&lt;/p&gt;
&lt;!-- break --&gt;

&lt;pre&gt;&lt;code class="language-php"&gt;
/**
 * Implements hook_menu().
 */
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Wouldn't it be nice if you could just type in "menu" and Vim could just fill it our for you? Here follows a little Vim script for inserting a "hook implements" comment at the current cursor position.&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-vim"&gt;
function! DrupalImplementsComment(hook)
  set paste

  exe "normal! i/**\&lt;cr&gt;"
  \          . " * Implements hook_" . a:hook . "()\&lt;cr&gt;"
  \          . " */\&lt;esc&gt;"

  set nopaste
endfunction

map &lt;c-c&gt;&lt;c-c&gt;&lt;c-c&gt; :call DrupalImplementsComment(input("Enter Hook name:"))&lt;cr&gt;
&lt;/cr&gt;&lt;/c-c&gt;&lt;/c-c&gt;&lt;/c-c&gt;&lt;/esc&gt;&lt;/cr&gt;&lt;/cr&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Wherever your cursor is, press Ctrl+C 3 times, you then get prompted to enter the hook name. When you press enter, a comment gets inserted. Hopefully this will save someone some time - its already saving me time!&lt;/p&gt;

&lt;p&gt;To install the script, I just have it in a file called &lt;code&gt;DrupalCommenting.vim&lt;/code&gt; inside my &lt;code&gt;~/.vim/&lt;/code&gt; folder. Then, inside my &lt;code&gt;~/.vimrc&lt;/code&gt; file, I have a line which imports the source file, eg: &lt;code&gt;so ~/.vim/DrupalCommenting.vim&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Any improvements very welcome!&lt;/p&gt;
&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=Quick%20Tip%3A%20Drupal%20Hook%20Commenting%20Using%20Vim&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/14-11-2011/quick-tip-drupal-hook-commenting-using-vim&amp;amp;2=node/418&amp;amp;3=a%3A0%3A%7B%7D" token="INRIr4Ghemnqizmy3Lk6GlWvhPOsFm1ApcpqZPBiBKM"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Mon, 14 Nov 2011 17:50:52 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">418 at https://www.thingy-ma-jig.co.uk</guid>
    </item>
<item>
  <title>JQuery Table Sorter Bookmarklet</title>
  <link>https://www.thingy-ma-jig.co.uk/blog/25-10-2011/jquery-table-sorter-bookmarklet</link>
  <description>
&lt;span&gt;JQuery Table Sorter Bookmarklet&lt;/span&gt;

      &lt;span class="tags"&gt;
      &lt;i class="fa fa-tags" aria-hidden="true"&gt;&lt;/i&gt;

              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/javascript" hreflang="en"&gt;javascript&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/programming" hreflang="en"&gt;programming&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/webdev" hreflang="en"&gt;webdev&lt;/a&gt;&lt;/span&gt;
              &lt;span&gt;&lt;a href="https://www.thingy-ma-jig.co.uk/tags/jquery" hreflang="en"&gt;jquery&lt;/a&gt;&lt;/span&gt;
          &lt;/span&gt;
  
&lt;span&gt;&lt;span&gt;Nicholas Thompson&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;time datetime="2011-10-25T10:49:04+01:00" title="Tuesday, October 25, 2011 - 10:49"&gt;Tue, 25/1049/2011 - 10:49&lt;/time&gt;
&lt;/span&gt;
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"&gt;&lt;p&gt;&lt;a href="https://twitter.com/lovepeacenukes"&gt;Christian Bach&lt;/a&gt; has made an awesome JQuery plugin to turn any HTML &lt;a href="http://tablesorter.com/docs/"&gt;Table into a real-time sortable table&lt;/a&gt; using &lt;a href="http://jquery.com/"&gt;Jquery&lt;/a&gt;. I recently needed to turn this into a &lt;a href="http://en.wikipedia.org/wiki/Bookmarklet"&gt;Bookmarklet&lt;/a&gt; so that I could embed it onto a page to sort a large table (I did not have access to the server-side code for this table).&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;If you drag the following link into the bookmarks toolbar of your browser, you can turn &lt;strong&gt;any table&lt;/strong&gt; on &lt;strong&gt;any website&lt;/strong&gt; into a sortable table!&lt;/p&gt;
&lt;br&gt;
&lt;h3 style="text-align:center"&gt;&lt;a onclick="window.alert('You shouldn't click this. Instead, please drag it into your bookmarks toolbar.');return false;" href="javascript:(function(){var%20head=document.getElementsByTagName('head')[0],script=document.createElement('script');script.type='text/javascript';script.src='http://www.thingy-ma-jig.co.uk/sites/thingy-ma-jig.co.uk/files/blog-attachments/tablesorter-bookmarklet-1.0.js?'+Date.now();head.appendChild(script);})();%20void%200"&gt;Table Sorter Bookmarklet&lt;/a&gt;&lt;/h3&gt;
&lt;br&gt;&lt;/div&gt;
                  &lt;div class="field field--name-field-disqus-comments field--type-disqus-comment field--label-hidden field__item"&gt;&lt;drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=JQuery%20Table%20Sorter%20Bookmarklet&amp;amp;1=https%3A//www.thingy-ma-jig.co.uk/blog/25-10-2011/jquery-table-sorter-bookmarklet&amp;amp;2=node/417&amp;amp;3=a%3A0%3A%7B%7D" token="QHOmqAipxddEUwKiMPlra7LG_p1oTha51a6ZnJokYAY"&gt;&lt;/drupal-render-placeholder&gt;&lt;/div&gt;
      </description>
  <pubDate>Tue, 25 Oct 2011 09:49:04 +0000</pubDate>
    <dc:creator>Nicholas Thompson</dc:creator>
    <guid isPermaLink="false">417 at https://www.thingy-ma-jig.co.uk</guid>
    </item>

  </channel>
</rss>
