<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - karlhorky</title>
<link>http://snipplr.com/users/karlhorky</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Tue, 21 May 2013 20:14:49 GMT</pubDate>
<item>
<title>(jQuery) Get element's html before and after specified html string</title>
<link>http://snipplr.com/view/47888/get-elements-html-before-and-after-specified-html-string/</link>
<description><![CDATA[ <p>Get an element's html occurring before and after a specified string of html


Code modified from pastebin shared in StackOverflow answer:

http://stackoverflow.com/questions/1746115/jquery-substring-to-truncate-text#answer-1746142
http://pastebin.com/f737f7ce9</p> ]]></description>
<pubDate>Wed, 26 Jan 2011 11:48:24 GMT</pubDate>
<guid>http://snipplr.com/view/47888/get-elements-html-before-and-after-specified-html-string/</guid>
</item>
<item>
<title>(XHTML) Test webpage for all common xhtml tags</title>
<link>http://snipplr.com/view/45211/test-webpage-for-all-common-xhtml-tags/</link>
<description><![CDATA[ <p>During the template design phase of a website, I like to break down my work into identifiable phases. One of such phases that I go through is writing the markup for the website. I typically write the markup for the website before I write any css styles in order to come up with the most semantic xhtml possible. One last step that I take before finishing the markup and start applying styles is adding this snippet's test content to my content element. The test content in this snippet allows for testing of styles on all common xhtml tags, effectively simulating the appearance of any webpage on your site. As long as you have included styling for all of these major xhtml tags, elements on this page should appear as they do in your final product.</p> ]]></description>
<pubDate>Fri, 03 Dec 2010 07:12:24 GMT</pubDate>
<guid>http://snipplr.com/view/45211/test-webpage-for-all-common-xhtml-tags/</guid>
</item>
<item>
<title>(PHP) Pass anonymous function (lambda) as parameter prior to PHP 5.3</title>
<link>http://snipplr.com/view/44972/pass-anonymous-function-lambda-as-parameter-prior-to-php-53/</link>
<description><![CDATA[ <p>Prior to 5.3, anonymous functions (lambdas) can be achieved via the create_function PHP function. This allows for the anonymous functions to be passed as parameters to another function as well, illustrated in this example snippet.</p> ]]></description>
<pubDate>Sun, 28 Nov 2010 05:50:55 GMT</pubDate>
<guid>http://snipplr.com/view/44972/pass-anonymous-function-lambda-as-parameter-prior-to-php-53/</guid>
</item>
<item>
<title>(PHP) RSS Feed Folder v1.1</title>
<link>http://snipplr.com/view/43740/rss-feed-folder-v11/</link>
<description><![CDATA[ <p>This script is a modification of the RSS Feed Folder script available at http://www.rssFeedFolder.com/ . The original script created an RSS feed based on the latest changed  files by html title and meta description tags. My modification removes the html components of the original script, instead aiming to generate an RSS feed with the latest files (recursive) in the specified directory.


The updated script achieves this by looping recursively through all directories that it finds within the specified path and listing out the file names and modification times (filemtime) as it goes. Once it has an array of all filenames with their modification times, it reverse sorts this list and does an array_slice on the first $rssMaxItems to be displayed. Finally, the script echos all the items in RSS format.</p> ]]></description>
<pubDate>Mon, 08 Nov 2010 11:05:02 GMT</pubDate>
<guid>http://snipplr.com/view/43740/rss-feed-folder-v11/</guid>
</item>
<item>
<title>(HTML) All HTML 4.01 / XHTML 1.0 closing tags (minus html, head, and body), as per W3Schools</title>
<link>http://snipplr.com/view/40714/all-html-401--xhtml-10-closing-tags-minus-html-head-and-body-as-per-w3schools/</link>
<description><![CDATA[ <p>All HTML 4.01 / XHTML 1.0 closing tags (minus html, head, and body), as per W3Schools</p> ]]></description>
<pubDate>Sat, 18 Sep 2010 09:49:46 GMT</pubDate>
<guid>http://snipplr.com/view/40714/all-html-401--xhtml-10-closing-tags-minus-html-head-and-body-as-per-w3schools/</guid>
</item>
<item>
<title>(Other) AutoHotkey: NiftyWindows Mod</title>
<link>http://snipplr.com/view/38654/autohotkey-niftywindows-mod/</link>
<description><![CDATA[ <p>A modification of the NiftyWindows AutoHotkey script, this snippet attempts to solve the following issues that I have been experiencing with the original script:
*  Middle click sends double click. This causes an issue for me as I use middle clicks to close:
  *   Tabs
  *  Applications using the title bar (this snippet adds this functionality)
  *  Applications using the task bar (this snippet allows middle clicks through to non-title bar areas if right button is not also pressed)</p> ]]></description>
<pubDate>Sat, 07 Aug 2010 03:43:08 GMT</pubDate>
<guid>http://snipplr.com/view/38654/autohotkey-niftywindows-mod/</guid>
</item>
<item>
<title>(JavaScript) jQuery: Check for existence of element</title>
<link>http://snipplr.com/view/37929/jquery-check-for-existence-of-element/</link>
<description><![CDATA[ <p>From the jQuery documentation:

You can use the length property of the jQuery collection returned by your selector. 

Note: It isn't always necessary to test whether an element exists. The following code would show the item if it exists, and do nothing (no errors) if it did not:</p> ]]></description>
<pubDate>Tue, 27 Jul 2010 08:12:17 GMT</pubDate>
<guid>http://snipplr.com/view/37929/jquery-check-for-existence-of-element/</guid>
</item>
<item>
<title>(Windows Registry) Disable Windows Share Drag and Drop Confirmation caused by IE 7 on XP SP3</title>
<link>http://snipplr.com/view/37724/disable-windows-share-drag-and-drop-confirmation-caused-by-ie-7-on-xp-sp3/</link>
<description><![CDATA[ <p>Internet Explorer 7 under Windows XP Service Pack 3 has the Windows Registry "Reserved Value" 180D set that was not set before, which can cause  a "Do you want to move or copy files from this zone?" prompt on moves or copies between Windows shares if they are incorrectly detected as being part of the Internet Zone. The registry solution in this snippet will disable this confirmation message.


References:

"Reserved value" 180D (Microsoft.com: Internet Explorer security zones registry entries for advanced users):

http://support.microsoft.com/kb/182569


Discussion of Windows Registry solution:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windowsxp.general&amp;tid=6f434a2d-cb47-47c4-b73a-f85459d27c51&amp;cat=en_US_91a15a1e-b269-4291-b6b4-dc2d504ce9ef&amp;lang=en&amp;cr=US&amp;sloc=en-us&amp;m=1&amp;p=1


"Do you want to move or copy files from this zone?" Prompt Example:

http://www.howtogeek.com/wp-content/uploads/2008/07/image56.png</p> ]]></description>
<pubDate>Thu, 22 Jul 2010 04:27:02 GMT</pubDate>
<guid>http://snipplr.com/view/37724/disable-windows-share-drag-and-drop-confirmation-caused-by-ie-7-on-xp-sp3/</guid>
</item>
<item>
<title>(CSS) CSS: Submit Button Background Images</title>
<link>http://snipplr.com/view/37068/css-submit-button-background-images/</link>
<description><![CDATA[ <p>There are three different types of elements that submit forms:

*  &amp;lt;input type="image"&amp;gt;
*  &amp;lt;input type="submit"&amp;gt;
*  &amp;lt;button type="submit"&amp;gt;

Logically, it would seem that you would want to use input type="image" if you wanted to display an image instead of a default button. However, using input type="image" causes the page to submit two extra variables for your x and y mouse click coordinates on the image as below. Unless you are specifically using this for advertising or some purpose that takes advantage of the coordinates, this is just unnecessary data that also causes the URL to become more complex.

Example URLs:

*  type="submit"
  *  http://www.site.com/form.php?query=searchterm
*  type="image"
  *  http://www.site.com/form.php?query=searchterm&amp;x=0&amp;y=0

Additionally, if you do not require additional information pertaining to the submit to be passed to the server (eg. you do not need to have two submits with different purposes), you can use a button element instead of an input. This also allows for simple hiding of the display text as outlined with the .hide-text class in this snippet (for if you wanted to put the text in the image instead).

This solution has been tested to work in:

*  Microsoft Internet Explorer 6, 7, 8
*  Mozilla Firefox 3.6
*  Google Chrome 5
*  Apple Safari 5
*  Opera 10</p> ]]></description>
<pubDate>Sat, 10 Jul 2010 08:45:15 GMT</pubDate>
<guid>http://snipplr.com/view/37068/css-submit-button-background-images/</guid>
</item>
<item>
<title>(CSS) CSS: Printer Friendly Header Visibility Styles</title>
<link>http://snipplr.com/view/36887/css-printer-friendly-header-visibility-styles/</link>
<description><![CDATA[ <p>When developing a website, an important consideration is accessibility on other media, including the medium of print. However, the printing engines of most browsers render content differently to allow for simple printed pages. One of the most notable differences is the omission of background images by default in modern browsers' print output. Background images are commonly used for header elements, which causes missing branding in the resulting printed pages.
 
One option defined in this snippet is to add markup after your normal header for a 0 pixel by 0 pixel `` element (your print version header), and then style the two headers as invisible and visible based upon the stylesheet medium. So when you're viewing the screen version of the page the normal header will be visible and the print header will be an invisible element with a width and height of 0 pixels. With the print version of the page the normal header will not be displayed at all and the print header will be a visible element that is floated and correctly sized.

This solution has been tested to work in:

*  Microsoft Internet Explorer 6, 7, 8
*  Mozilla Firefox 3.6
*  Google Chrome 5
*  Apple Safari 4
*  Opera 10</p> ]]></description>
<pubDate>Thu, 08 Jul 2010 04:43:28 GMT</pubDate>
<guid>http://snipplr.com/view/36887/css-printer-friendly-header-visibility-styles/</guid>
</item>
<item>
<title>(Bash) Bash (Command Line): Loop through directories in specified location, replacing directories in current directory (with backup)</title>
<link>http://snipplr.com/view/35126/bash-command-line-loop-through-directories-in-specified-location-replacing-directories-in-current-directory-with-backup/</link>
<description><![CDATA[ <p>This command line aims at moving directories from a target location to the present working directory (pwd), backing the pwd directories up as it encounters them.

The script works by:

1. Iterating through the contents of the target directory (using the unix ls command)

2. Checking whether the current object is a directory

3. Moving the pwd directory to a backup location using the unix mv command

4. Moving the target location's directory to the present working directory

5. Printing out the modified directory's name using the unix echo command</p> ]]></description>
<pubDate>Sun, 23 May 2010 15:24:10 GMT</pubDate>
<guid>http://snipplr.com/view/35126/bash-command-line-loop-through-directories-in-specified-location-replacing-directories-in-current-directory-with-backup/</guid>
</item>
<item>
<title>(DOS Batch) DOS Batch: Mirror Contents of One Directory to Another with Prompt using Robocopy</title>
<link>http://snipplr.com/view/32086/dos-batch-mirror-contents-of-one-directory-to-another-with-prompt-using-robocopy/</link>
<description><![CDATA[ <p>This batch mirrors the contents of one directory to another using Robocopy. It will display a list of what is being mirrored before prompting the user for confirmation on the mirror.

WARNING: Robocopy's /MIR switch that is used in this batch WILL remove any destination objects not present in the source directory</p> ]]></description>
<pubDate>Thu, 15 Apr 2010 17:35:40 GMT</pubDate>
<guid>http://snipplr.com/view/32086/dos-batch-mirror-contents-of-one-directory-to-another-with-prompt-using-robocopy/</guid>
</item>
<item>
<title>(Windows Registry) Windows Registry: Set open folder default icons for all A-Z drive letters and Desktop Shell Folder in Windows 7</title>
<link>http://snipplr.com/view/31208/windows-registry-set-open-folder-default-icons-for-all-az-drive-letters-and-desktop-shell-folder-in-windows-7/</link>
<description><![CDATA[ <p>Based upon the Drive Icon Change Windows Vista tweak  and the shell icons registry settings found at the respective links below, this Windows 7 / Vista tweak will set the default icon of all A-Z drive letters (like C: for instance) and the Desktop to the open folder icon that Windows uses. This tweak is one step towards the final goal of having a standard default taskbar icon for Windows Explorer, irrespective of the current location of the Explorer instance.

Of course, a better solution would be an application to modify Windows Explorer so that its taskbar icon is configurable, but I have yet to find (or make) a solution that would be this flexible.

Drive Icon Change - Vista Forums: http://www.vistax64.com/tutorials/111388-drive-icon-change.html

Shell icons registry settings: http://www.virtualplastic.net/html/icn_reg.html#shellicons</p> ]]></description>
<pubDate>Sat, 10 Apr 2010 18:16:09 GMT</pubDate>
<guid>http://snipplr.com/view/31208/windows-registry-set-open-folder-default-icons-for-all-az-drive-letters-and-desktop-shell-folder-in-windows-7/</guid>
</item>
<item>
<title>(Visual Basic) WSH (VBScript): Windows 7 New File Context Menu Item</title>
<link>http://snipplr.com/view/30935/wsh-vbscript-windows-7-new-file-context-menu-item/</link>
<description><![CDATA[ <p>A modification of Bill James' New Folder context menu script ( http://billsway.com/vbspage/ ), this script instead creates a "New File" item in the right click context menu of Directory Backgrounds. Upon running the New File item, you will be prompted for a filename that defaults to "new.txt". Once a valid filename has been entered (not an existing file) the script will then create the file. This allows the filename to be chosen in the dialog before any file creation has been executed. This has been tested to work on Windows 7 but may work on Vista as well.

Make the code below into a vbs file in the location you want it to be installed in (eg. C:\Windows\NewFile.vbs). To install the context menu item, run the vbs file. To uninstall the file, run the vbs file again.</p> ]]></description>
<pubDate>Mon, 05 Apr 2010 16:54:54 GMT</pubDate>
<guid>http://snipplr.com/view/30935/wsh-vbscript-windows-7-new-file-context-menu-item/</guid>
</item>
<item>
<title>(Windows Registry) MSI Right-click Context Menu: Install As (other user or administrator)</title>
<link>http://snipplr.com/view/24223/msi-rightclick-context-menu-install-as-other-user-or-administrator/</link>
<description><![CDATA[ <p>RunAs is a great way of temporarily elevating your privileges to admin level when you are logged on as an ordinary user. However, while you can right-click on .exe files and select Run As from the shortcut menu, this doesn't work with Windows Installer (.msi) packages. 

Here's a workaround that makes this possible. 

Credit for this trick goes to: http://www.windowsnetworking.com/kbase/WindowsTips/WindowsXP/RegistryTips/Security/InstallingMSIPackageswithElevatedPrivileges.html</p> ]]></description>
<pubDate>Thu, 03 Dec 2009 13:34:24 GMT</pubDate>
<guid>http://snipplr.com/view/24223/msi-rightclick-context-menu-install-as-other-user-or-administrator/</guid>
</item>
<item>
<title>(Regular Expression) Regular Expression Search / Replace (PSPad): Replace Empty Footnotes Anchors with Linked Numbers</title>
<link>http://snipplr.com/view/22870/regular-expression-search--replace-pspad-replace-empty-footnotes-anchors-with-linked-numbers/</link>
<description><![CDATA[ <p>This search and replace fixes empty footnote anchors that appear when copying / pasting Word content into a Dreamweaver html document.</p> ]]></description>
<pubDate>Tue, 10 Nov 2009 13:10:48 GMT</pubDate>
<guid>http://snipplr.com/view/22870/regular-expression-search--replace-pspad-replace-empty-footnotes-anchors-with-linked-numbers/</guid>
</item>
<item>
<title>(Regular Expression) Regular Expression Search / Replace (PSPad): Replace Fake Links (Underlined Text) with Real Links</title>
<link>http://snipplr.com/view/22002/regular-expression-search--replace-pspad-replace-fake-links-underlined-text-with-real-links/</link>
<description><![CDATA[ <p>Sometimes HTML provided by clients or generated by WYSIWYGs contains links as plaintext with underlines in many instances and stripping this out by hand is time consuming. This search and replace (tested in PSPad, but may work in other code editors) will do the job for you.</p> ]]></description>
<pubDate>Tue, 27 Oct 2009 22:01:54 GMT</pubDate>
<guid>http://snipplr.com/view/22002/regular-expression-search--replace-pspad-replace-fake-links-underlined-text-with-real-links/</guid>
</item>
<item>
<title>(JavaScript) Javascript Select Dropdown Box (Defaults To Last Option Selected)</title>
<link>http://snipplr.com/view/22001/javascript-select-dropdown-box-defaults-to-last-option-selected/</link>
<description><![CDATA[ <p>This javascript creates and writes out an HTML  dropdown box that defaults to the last option parameter passed to page. Could be used as part of a form.</p> ]]></description>
<pubDate>Tue, 27 Oct 2009 21:41:49 GMT</pubDate>
<guid>http://snipplr.com/view/22001/javascript-select-dropdown-box-defaults-to-last-option-selected/</guid>
</item>
<item>
<title>(ASP) ASP (vbscript): Retrieve Remote XML RSS Feed, Modify Using Regular Expression, and then Save to Local XML File</title>
<link>http://snipplr.com/view/20484/asp-vbscript-retrieve-remote-xml-rss-feed-modify-using-regular-expression-and-then-save-to-local-xml-file/</link>
<description><![CDATA[ <p>This script will retrieve a remote xml rss feed, modify it based upon a date extracted from a remote html document (using a regular expression), and save it to a local file.</p> ]]></description>
<pubDate>Wed, 30 Sep 2009 15:00:49 GMT</pubDate>
<guid>http://snipplr.com/view/20484/asp-vbscript-retrieve-remote-xml-rss-feed-modify-using-regular-expression-and-then-save-to-local-xml-file/</guid>
</item>
<item>
<title>(Perl) Perl: Modify XML Feed Items' pubDate</title>
<link>http://snipplr.com/view/20443/perl-modify-xml-feed-items-pubdate/</link>
<description><![CDATA[ <p>Read in a remote XML file, change the pubDate date format, and output to specific local file.</p> ]]></description>
<pubDate>Tue, 29 Sep 2009 17:14:35 GMT</pubDate>
<guid>http://snipplr.com/view/20443/perl-modify-xml-feed-items-pubdate/</guid>
</item>
</channel>
</rss>