<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - jonathanpglick</title>
<link>http://snipplr.com/users/jonathanpglick</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 19 Jun 2013 19:12:43 GMT</pubDate>
<item>
<title>(PHP) Drupal Format time ago</title>
<link>http://snipplr.com/view/63570/drupal-format-time-ago/</link>
<description><![CDATA[ <p>Foromat {timestamp} as a "x x ago" date/time.</p> ]]></description>
<pubDate>Sat, 25 Feb 2012 05:18:52 GMT</pubDate>
<guid>http://snipplr.com/view/63570/drupal-format-time-ago/</guid>
</item>
<item>
<title>(PHP) Trigger a Drupal Context programatically</title>
<link>http://snipplr.com/view/58723/trigger-a-drupal-context-programatically/</link>
<description><![CDATA[ <p>It's not immediately clear from the `context_set()` function how to trigger a context to be "active" using code.  Do it like this:</p> ]]></description>
<pubDate>Fri, 16 Sep 2011 02:41:00 GMT</pubDate>
<guid>http://snipplr.com/view/58723/trigger-a-drupal-context-programatically/</guid>
</item>
<item>
<title>(Apache) .htaccess disable magic_quotes</title>
<link>http://snipplr.com/view/57013/htaccess-disable-magicquotes/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 22 Jul 2011 04:11:28 GMT</pubDate>
<guid>http://snipplr.com/view/57013/htaccess-disable-magicquotes/</guid>
</item>
<item>
<title>(JavaScript) Drupal collapsible fieldset script with trigger to resize TinyMCE</title>
<link>http://snipplr.com/view/54811/drupal-collapsible-fieldset-script-with-trigger-to-resize-tinymce/</link>
<description><![CDATA[ <p>This override function for the default Drupal.toggleFieldset function adds code that looks for instances of TinyMCE inside the fieldset and triggers the autoresize on them when the fieldset is opened.  Otherwise TinyMCE renders with a weird height.</p> ]]></description>
<pubDate>Fri, 03 Jun 2011 10:12:57 GMT</pubDate>
<guid>http://snipplr.com/view/54811/drupal-collapsible-fieldset-script-with-trigger-to-resize-tinymce/</guid>
</item>
<item>
<title>(PHP) Render single node field</title>
<link>http://snipplr.com/view/47887/render-single-node-field/</link>
<description><![CDATA[ <p>Render the contents for a single node field.</p> ]]></description>
<pubDate>Wed, 26 Jan 2011 10:51:22 GMT</pubDate>
<guid>http://snipplr.com/view/47887/render-single-node-field/</guid>
</item>
<item>
<title>(PHP) OMBU Drupal string overrides</title>
<link>http://snipplr.com/view/45206/ombu-drupal-string-overrides/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 03 Dec 2010 05:44:56 GMT</pubDate>
<guid>http://snipplr.com/view/45206/ombu-drupal-string-overrides/</guid>
</item>
<item>
<title>(PHP) Split array into n arrays (columns)</title>
<link>http://snipplr.com/view/44841/split-array-into-n-arrays-columns/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 25 Nov 2010 10:57:14 GMT</pubDate>
<guid>http://snipplr.com/view/44841/split-array-into-n-arrays-columns/</guid>
</item>
<item>
<title>(JavaScript) Javascript Random number between</title>
<link>http://snipplr.com/view/44702/javascript-random-number-between/</link>
<description><![CDATA[ <p>Uses vars `to` and `from`.</p> ]]></description>
<pubDate>Tue, 23 Nov 2010 06:17:59 GMT</pubDate>
<guid>http://snipplr.com/view/44702/javascript-random-number-between/</guid>
</item>
<item>
<title>(PHP) Drupal 6 node_export inport don't make pathauto alias</title>
<link>http://snipplr.com/view/43529/drupal-6-nodeexport-inport-dont-make-pathauto-alias/</link>
<description><![CDATA[ <p>If you're importing nodes from a file and have pathauto setup, the existing paths for the nodes will be rewritten with pathauto.  To avoid this, simply add the following to the node export array for each node:</p> ]]></description>
<pubDate>Thu, 04 Nov 2010 07:23:59 GMT</pubDate>
<guid>http://snipplr.com/view/43529/drupal-6-nodeexport-inport-dont-make-pathauto-alias/</guid>
</item>
<item>
<title>(PHP) Drupal get total number of search results from pager</title>
<link>http://snipplr.com/view/43453/drupal-get-total-number-of-search-results-from-pager/</link>
<description><![CDATA[ <p>The total number of search results can be added in a hook_preprocess_search_results() function from the following variable:</p> ]]></description>
<pubDate>Wed, 03 Nov 2010 04:52:52 GMT</pubDate>
<guid>http://snipplr.com/view/43453/drupal-get-total-number-of-search-results-from-pager/</guid>
</item>
<item>
<title>(PHP) Drupal render Views pager from $view object</title>
<link>http://snipplr.com/view/43273/drupal-render-views-pager-from-view-object/</link>
<description><![CDATA[ <p>Drupal 6

Do this after $view->execute() has already been called</p> ]]></description>
<pubDate>Sat, 30 Oct 2010 06:07:46 GMT</pubDate>
<guid>http://snipplr.com/view/43273/drupal-render-views-pager-from-view-object/</guid>
</item>
<item>
<title>(Bash) Remove untracked files from Mercurial repository</title>
<link>http://snipplr.com/view/42950/remove-untracked-files-from-mercurial-repository/</link>
<description><![CDATA[ <p>the -u flag only lists items that are "unknown", -0 prepares the filenames for xargs.

xargs then runs "rm" on each of the listed files.</p> ]]></description>
<pubDate>Tue, 26 Oct 2010 04:45:53 GMT</pubDate>
<guid>http://snipplr.com/view/42950/remove-untracked-files-from-mercurial-repository/</guid>
</item>
<item>
<title>(PHP) Drupal - Programatically trigger another theme</title>
<link>http://snipplr.com/view/37256/drupal--programatically-trigger-another-theme/</link>
<description><![CDATA[ <p>This example triggers the admin theme when on any of the user/* pages (login, edit, etc.).  Put the name of your admin theme in {admin-theme-name} so there's a safe fallback in case variable_get doesn't find the admin_theme.</p> ]]></description>
<pubDate>Wed, 14 Jul 2010 06:46:44 GMT</pubDate>
<guid>http://snipplr.com/view/37256/drupal--programatically-trigger-another-theme/</guid>
</item>
<item>
<title>(PHP) Drupal Date Popup from Form API</title>
<link>http://snipplr.com/view/36038/drupal-date-popup-from-form-api/</link>
<description><![CDATA[ <p>I can never remember how to trigger the Date Popup widget when writing a $form in Drupal so I've pulled out the instructions below.

This requires that the date_api, date_timezone and date_popup modules are all enabled.</p> ]]></description>
<pubDate>Wed, 23 Jun 2010 09:59:25 GMT</pubDate>
<guid>http://snipplr.com/view/36038/drupal-date-popup-from-form-api/</guid>
</item>
<item>
<title>(PHP) Trigger WYSIWYG editor in Drupal Form API</title>
<link>http://snipplr.com/view/35992/trigger-wysiwyg-editor-in-drupal-form-api/</link>
<description><![CDATA[ <p>The trick is having a "format" key for the textarea and using filter_form().

Use two elements with the same parent; the textarea element and an element with the "format" key. (important!).

Example below.</p> ]]></description>
<pubDate>Tue, 22 Jun 2010 07:08:20 GMT</pubDate>
<guid>http://snipplr.com/view/35992/trigger-wysiwyg-editor-in-drupal-form-api/</guid>
</item>
<item>
<title>(CSS) IE 6 &amp;amp; 7 Input[type="submit"] horizontal padding hack</title>
<link>http://snipplr.com/view/35265/ie-6--7-inputtypesubmit-horizontal-padding-hack/</link>
<description><![CDATA[ <p>IE6 &amp; IE7 set their own horizontal padding on submit input elements.  This will make them behave more like they should.</p> ]]></description>
<pubDate>Thu, 27 May 2010 14:16:22 GMT</pubDate>
<guid>http://snipplr.com/view/35265/ie-6--7-inputtypesubmit-horizontal-padding-hack/</guid>
</item>
<item>
<title>(Bash) Postgres SQL dump</title>
<link>http://snipplr.com/view/35235/postgres-sql-dump/</link>
<description><![CDATA[ <p>**flags:**

* -c : include commands to clean (drop) database objects prior to creating them   
* -C : include commands to create the database itself   
* -U : user to connect as</p> ]]></description>
<pubDate>Wed, 26 May 2010 13:03:19 GMT</pubDate>
<guid>http://snipplr.com/view/35235/postgres-sql-dump/</guid>
</item>
<item>
<title>(Bash) Postgres load / import SQL</title>
<link>http://snipplr.com/view/35234/postgres-load--import-sql/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 26 May 2010 12:39:45 GMT</pubDate>
<guid>http://snipplr.com/view/35234/postgres-load--import-sql/</guid>
</item>
<item>
<title>(PHP) Trigger Drupal Admin Theme</title>
<link>http://snipplr.com/view/30708/trigger-drupal-admin-theme/</link>
<description><![CDATA[ <p>Needs to execute before theme is initialized -- Ideally in hook_init() -- but also works in hook_nodeapi $op == 'view'</p> ]]></description>
<pubDate>Thu, 01 Apr 2010 12:52:52 GMT</pubDate>
<guid>http://snipplr.com/view/30708/trigger-drupal-admin-theme/</guid>
</item>
<item>
<title>(PHP) Drupal - get email addresses by role</title>
<link>http://snipplr.com/view/29899/drupal--get-email-addresses-by-role/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 17 Mar 2010 12:54:43 GMT</pubDate>
<guid>http://snipplr.com/view/29899/drupal--get-email-addresses-by-role/</guid>
</item>
</channel>
</rss>