<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - noah</title>
<link>http://snipplr.com/users/noah/tags/tools</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 26 May 2013 08:23:49 GMT</pubDate>
<item>
<title>(Perl) Detect PHP files with trailing whitespace, using Perl</title>
<link>http://snipplr.com/view/46218/detect-php-files-with-trailing-whitespace-using-perl/</link>
<description><![CDATA[ <p>The following incantation returns nonzero exit status when the terminating `?>`  of a PHP file, is followed by whitespace.</p> ]]></description>
<pubDate>Wed, 29 Dec 2010 08:25:03 GMT</pubDate>
<guid>http://snipplr.com/view/46218/detect-php-files-with-trailing-whitespace-using-perl/</guid>
</item>
<item>
<title>(Bash) increment a counter in bash</title>
<link>http://snipplr.com/view/44406/increment-a-counter-in-bash/</link>
<description><![CDATA[ <p>Spoof the Hudson BUILD_NUMBER environment variable, which increments on every build.

With this tiny hack you can fake a BUILD_NUMBER that you can increment by hand.

Useful for testing Hudson build scripts.</p> ]]></description>
<pubDate>Fri, 19 Nov 2010 07:37:56 GMT</pubDate>
<guid>http://snipplr.com/view/44406/increment-a-counter-in-bash/</guid>
</item>
<item>
<title>(Bash) verify a service is up and running with netcat and Hudson</title>
<link>http://snipplr.com/view/41390/verify-a-service-is-up-and-running-with-netcat-and-hudson/</link>
<description><![CDATA[ <p>Use the `-z` option to netcat so you don\\\\\\\'t have to bother with piping input into the port once opened.  All you want to know is if the service is up!\\r\\n\\r\\nThen, if you are running this checker inside of Hudson, you need to set the BUILD_ID env var to something abitrary like BUILD_ID=dontKill\\r\\n\\r\\nKludgy, but [it works](http://issues.hudson-ci.org/browse/HUDSON-2729?focusedCommentId=127805&amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_127805)</p> ]]></description>
<pubDate>Sun, 03 Oct 2010 16:11:56 GMT</pubDate>
<guid>http://snipplr.com/view/41390/verify-a-service-is-up-and-running-with-netcat-and-hudson/</guid>
</item>
<item>
<title>(Bash) kill zombie processes</title>
<link>http://snipplr.com/view/41095/kill-zombie-processes/</link>
<description><![CDATA[ <p>Thanks to [Kastner](http://metaatem.net/) for these snippets.</p> ]]></description>
<pubDate>Tue, 28 Sep 2010 07:14:38 GMT</pubDate>
<guid>http://snipplr.com/view/41095/kill-zombie-processes/</guid>
</item>
<item>
<title>(Other) How to configure the output format of the W3 CSS Validator</title>
<link>http://snipplr.com/view/19817/how-to-configure-the-output-format-of-the-w3-css-validator/</link>
<description><![CDATA[ <p>The W3 CSS validator is pretty simple to [install locally for use behind the firewall](http://www.emacswiki.org/emacs/FlymakeCSS).

However, by default the validator spits out the whole CSS file after validation, which is inconvenient if your stylesheet is more than a few lines long.

Unfortunately it's not so obvious how to configure the validator to give pretty-printed, human-readable output.  In fact, all there is to it, is to choose a different output format from the several that are supported :)

By default the validator .jar file gives you "text" output, which includes the stylesheet.  To choose a different format, invoke the validator .jar file with an -output argument, like this:

    java -jar css-validator.jar -output  local-file:foo.css

where `` is any of xhtml, xml, text, soap12, json, ucn or gnu

If you just want the errors as (html-escaped) plain text, but without the CSS included, use `gnu`</p> ]]></description>
<pubDate>Wed, 16 Sep 2009 11:53:08 GMT</pubDate>
<guid>http://snipplr.com/view/19817/how-to-configure-the-output-format-of-the-w3-css-validator/</guid>
</item>
<item>
<title>(JavaScript) Describe Jira Task bookmarklet</title>
<link>http://snipplr.com/view/10133/describe-jira-task-bookmarklet/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 28 Nov 2008 11:59:05 GMT</pubDate>
<guid>http://snipplr.com/view/10133/describe-jira-task-bookmarklet/</guid>
</item>
<item>
<title>(Bash) grep for either of two strings</title>
<link>http://snipplr.com/view/6819/grep-for-either-of-two-strings/</link>
<description><![CDATA[ <p>Here's an example of using grep to filter for links that contain the string 'jpg' or 'gif'</p> ]]></description>
<pubDate>Fri, 20 Jun 2008 15:29:33 GMT</pubDate>
<guid>http://snipplr.com/view/6819/grep-for-either-of-two-strings/</guid>
</item>
<item>
<title>(Bash) Download linked JPEGs from a Web page, on the command line</title>
<link>http://snipplr.com/view/4063/download-linked-jpegs-from-a-web-page-on-the-command-line/</link>
<description><![CDATA[ <p>The following command will download all the files with a JPG extension that are linked from http://flickr.com.

_Requires the LWP and HTML::Tree Perl modules.  You must also have Wget installed on your system for this to work._</p> ]]></description>
<pubDate>Fri, 02 Nov 2007 22:57:45 GMT</pubDate>
<guid>http://snipplr.com/view/4063/download-linked-jpegs-from-a-web-page-on-the-command-line/</guid>
</item>
<item>
<title>(Bash) Create a directory recursively</title>
<link>http://snipplr.com/view/3979/create-a-directory-recursively/</link>
<description><![CDATA[ <p>Given the legal path of a nonexistent directory, create that path and directory.</p> ]]></description>
<pubDate>Tue, 23 Oct 2007 02:01:14 GMT</pubDate>
<guid>http://snipplr.com/view/3979/create-a-directory-recursively/</guid>
</item>
<item>
<title>(JavaScript) click on an element across browsers</title>
<link>http://snipplr.com/view/3336/click-on-an-element-across-browsers/</link>
<description><![CDATA[ <p>If you have assigned an event handler to a container, you might want to remotely trigger it as if a child of the container had been clicked.  That is, you might want to manually set the target of the 'event' object that is passed to the event handler on the container.  This helps to keep the number of event handlers down.</p> ]]></description>
<pubDate>Fri, 20 Jul 2007 18:08:37 GMT</pubDate>
<guid>http://snipplr.com/view/3336/click-on-an-element-across-browsers/</guid>
</item>
<item>
<title>(JavaScript) Crockford's object producer</title>
<link>http://snipplr.com/view/3154/crockfords-object-producer/</link>
<description><![CDATA[ <p>Note that this will /not/ work:
var a = {a:1, b:2}
var b = {prototype: a}</p> ]]></description>
<pubDate>Fri, 06 Jul 2007 21:06:54 GMT</pubDate>
<guid>http://snipplr.com/view/3154/crockfords-object-producer/</guid>
</item>
<item>
<title>(Perl) Remove duplicate lines from a text file with Perl</title>
<link>http://snipplr.com/view/3124/remove-duplicate-lines-from-a-text-file-with-perl/</link>
<description><![CDATA[ <p>*[Found at Google Answers.](http://answers.google.com/answers/threadview?id=25196)*

Sometimes I get a big list of things, and some of the things occur multiple times in the same list.  To make the list easier to read, I want to *delete* the duplicate lines.
 
A good example is a list of files that have errors (maybe excerpted from an application sever's log files).  In that case you have a newline-delimited list of file paths,  and depending upon the situation, the same file path might be listed 4 or 5 times or more.  Often, it is useful to have a list of just the files that are faulty, which can be produced by deleting all the duplicate lines.  This script is for filtering just those kinds of list files.

[Of course,](http://xkcd.com/378/ "emacs has a command for that")  for **Emacs** users  [there is a much easier way to remove duplicate lines:](http://everything2.com/title/useful%2520emacs%2520lisp%2520functions "useful emacs lisp functions"), if you have `uniq` installed on your system.

`M-x sort-lines RET C-x h M-x shell-command-on-region RET uniq RET`</p> ]]></description>
<pubDate>Tue, 03 Jul 2007 22:06:34 GMT</pubDate>
<guid>http://snipplr.com/view/3124/remove-duplicate-lines-from-a-text-file-with-perl/</guid>
</item>
<item>
<title>(JavaScript) Safely Get and Operate Upon An Element</title>
<link>http://snipplr.com/view/3071/safely-get-and-operate-upon-an-element/</link>
<description><![CDATA[ <p>Pass this an ID or an object reference, as well as any number of functions that take the referenced object as a parameter.  This wrapper is intended to provide a sanity check against missing DOM elements.</p> ]]></description>
<pubDate>Thu, 28 Jun 2007 20:09:25 GMT</pubDate>
<guid>http://snipplr.com/view/3071/safely-get-and-operate-upon-an-element/</guid>
</item>
<item>
<title>(Perl) rename - Larry Wall's filename fixer</title>
<link>http://snipplr.com/view/2677/rename--larry-walls-filename-fixer/</link>
<description><![CDATA[ <p>Invoke this script without any arguments to see the help text.  From the Perl Cookbook, Ch. 9.9.</p> ]]></description>
<pubDate>Mon, 21 May 2007 04:49:45 GMT</pubDate>
<guid>http://snipplr.com/view/2677/rename--larry-walls-filename-fixer/</guid>
</item>
</channel>
</rss>