<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - deepsoul</title>
<link>http://snipplr.com/users/deepsoul</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 23 May 2013 00:46:56 GMT</pubDate>
<item>
<title>(Perl) Process quoted text differently</title>
<link>http://snipplr.com/view/65684/process-quoted-text-differently/</link>
<description><![CDATA[ <p>This Perl snippet shows how to separate quoted parts from a text in order to process quoted and unquoted parts separately.  For example, you could expand variables or wildcards only in the unquoted part.  Then the different processed parts are put together again.

That a marker character "\x01" is used to mark the position of the quoted passages is a bit ugly, but on the other hand the single line of code putting the text together again is very elegant and shows off what Perl can do!</p> ]]></description>
<pubDate>Mon, 18 Jun 2012 05:00:57 GMT</pubDate>
<guid>http://snipplr.com/view/65684/process-quoted-text-differently/</guid>
</item>
<item>
<title>(Haskell) Simultaneous filter and  map</title>
<link>http://snipplr.com/view/59474/simultaneous-filter-and--map/</link>
<description><![CDATA[ <p>The `filtermap` functional below allows to perform the standard `map` and `filter` operations in one go.  The mapping function has to return a `Maybe` monad, and values of  `Nothing` are filtered out.</p> ]]></description>
<pubDate>Thu, 06 Oct 2011 07:53:01 GMT</pubDate>
<guid>http://snipplr.com/view/59474/simultaneous-filter-and--map/</guid>
</item>
<item>
<title>(Perl) Short-circuited Perl grep</title>
<link>http://snipplr.com/view/56382/shortcircuited-perl-grep/</link>
<description><![CDATA[ <p>To check the existence of an element in a Perl array with specific properties, one tends to use `grep`.  But this is inefficient because `grep` always checks each element. (Even in scalar context it returns the number of matching elements.)  The following function aborts after the first find.</p> ]]></description>
<pubDate>Mon, 11 Jul 2011 06:34:41 GMT</pubDate>
<guid>http://snipplr.com/view/56382/shortcircuited-perl-grep/</guid>
</item>
<item>
<title>(C) Determine word sizes by cross-compiling only</title>
<link>http://snipplr.com/view/56381/determine-word-sizes-by-crosscompiling-only/</link>
<description><![CDATA[ <p>You can find out the word sizes and endianness of a device by compiling the following program with a cross compiler and looking at the executable with the `strings` program or a hex editor.  The `TESTIF` macro puts a copy of the statement to test and its truth value into a string which will be present in the exe.  This helps if you do not have such a device handy, or if it is cumbersome to access (requires loading firmware etc.).</p> ]]></description>
<pubDate>Mon, 11 Jul 2011 06:08:22 GMT</pubDate>
<guid>http://snipplr.com/view/56381/determine-word-sizes-by-crosscompiling-only/</guid>
</item>
<item>
<title>(JavaScript) Bookmarklet to page history on the Internet Archive</title>
<link>http://snipplr.com/view/29991/bookmarklet-to-page-history-on-the-internet-archive/</link>
<description><![CDATA[ <p>This bookmarklet points to the Internet Archive overview page for the current page.  Insert it into your page or bookmark it [right here](javascript:location.href='http://web.archive.org/web/*/'+location.href).</p> ]]></description>
<pubDate>Thu, 18 Mar 2010 16:21:15 GMT</pubDate>
<guid>http://snipplr.com/view/29991/bookmarklet-to-page-history-on-the-internet-archive/</guid>
</item>
<item>
<title>(Haskell) Interval of integral points</title>
<link>http://snipplr.com/view/29989/interval-of-integral-points/</link>
<description><![CDATA[ <p>These functions return all points (pairs or triples of coordinates) within a given rectangle or box.  ``pam`` is the reverse map function which was defined [here](http://snipplr.com/view/18351/reverse-map/).</p> ]]></description>
<pubDate>Thu, 18 Mar 2010 16:15:42 GMT</pubDate>
<guid>http://snipplr.com/view/29989/interval-of-integral-points/</guid>
</item>
<item>
<title>(C) Log all output to file</title>
<link>http://snipplr.com/view/29987/log-all-output-to-file/</link>
<description><![CDATA[ <p>With the code fragment below, you can easily add output logging to a text-based program.  Add the functions, open the log file and replace calls to (f)printf by (f)printflog.</p> ]]></description>
<pubDate>Thu, 18 Mar 2010 16:03:19 GMT</pubDate>
<guid>http://snipplr.com/view/29987/log-all-output-to-file/</guid>
</item>
<item>
<title>(Perl) Downgrade Visual Studio project</title>
<link>http://snipplr.com/view/29986/downgrade-visual-studio-project/</link>
<description><![CDATA[ <p>Some (all?) Visual Studio projects can be opened with older versions without problems once their version numbers have been reduced.  The following Perl script does this; it also recurses over the projects contained in a project folder (.sln) file.  It saves you upgrading all your installations.</p> ]]></description>
<pubDate>Thu, 18 Mar 2010 15:33:24 GMT</pubDate>
<guid>http://snipplr.com/view/29986/downgrade-visual-studio-project/</guid>
</item>
<item>
<title>(Bash) Replace colour range</title>
<link>http://snipplr.com/view/26010/replace-colour-range/</link>
<description><![CDATA[ <p>This snippet shows how to replace the colours in a monochrome image, i.e. one which only contains two colours and the range of hues between them.</p> ]]></description>
<pubDate>Wed, 06 Jan 2010 07:44:53 GMT</pubDate>
<guid>http://snipplr.com/view/26010/replace-colour-range/</guid>
</item>
<item>
<title>(HTML) Google search form with additional keywords</title>
<link>http://snipplr.com/view/25508/google-search-form-with-additional-keywords/</link>
<description><![CDATA[ <p>The Google search URL accepts two fields, `as_oq` and `as_eq`, which give additional required or forbidden keywords for the search.  This allows to create search forms which add preset keywords.  In the search form below, one of the keywords test, review or evalutation is required, and none of "buy now", "special offer" and "free download" may be present.</p> ]]></description>
<pubDate>Sun, 27 Dec 2009 09:26:42 GMT</pubDate>
<guid>http://snipplr.com/view/25508/google-search-form-with-additional-keywords/</guid>
</item>
<item>
<title>(Bash) Retrieve administrator excuse</title>
<link>http://snipplr.com/view/23540/retrieve-administrator-excuse/</link>
<description><![CDATA[ <p>Jeff Ballard provides excuses in the style of the Bastard Operator From Hell via telnet.  The following should be defined as an alias (such as `excuse`) for easy access:</p> ]]></description>
<pubDate>Sat, 21 Nov 2009 15:58:34 GMT</pubDate>
<guid>http://snipplr.com/view/23540/retrieve-administrator-excuse/</guid>
</item>
<item>
<title>(Bash) Thumbnail table with date/time</title>
<link>http://snipplr.com/view/23113/thumbnail-table-with-datetime/</link>
<description><![CDATA[ <p>This script creates thumbnail images containing 25 thumbs each and display the EXIF time and date if your version of ImageMagick supports that (some do not).</p> ]]></description>
<pubDate>Sat, 14 Nov 2009 08:41:57 GMT</pubDate>
<guid>http://snipplr.com/view/23113/thumbnail-table-with-datetime/</guid>
</item>
<item>
<title>(Bash) copy, but never overwrite</title>
<link>http://snipplr.com/view/23111/copy-but-never-overwrite/</link>
<description><![CDATA[ <p>Useful if some files already exist at the destination and are newer or would take too long to copy again.</p> ]]></description>
<pubDate>Sat, 14 Nov 2009 07:48:11 GMT</pubDate>
<guid>http://snipplr.com/view/23111/copy-but-never-overwrite/</guid>
</item>
<item>
<title>(Bash) Replace background colour</title>
<link>http://snipplr.com/view/22290/replace-background-colour/</link>
<description><![CDATA[ <p>When you put an image in a printable document, you don't want it to have black (or coloured) background.  ImageMagick allows to replace colours even when the coloured regions are non-contiguous.  Arbitrary colour values can be specified with `\#123456` (the backslash is for escaping the #).  If you want to replace similar colours as well, use the `-fuzz` option.</p> ]]></description>
<pubDate>Sun, 01 Nov 2009 13:53:25 GMT</pubDate>
<guid>http://snipplr.com/view/22290/replace-background-colour/</guid>
</item>
<item>
<title>(Bash) Find newest file and its modification time</title>
<link>http://snipplr.com/view/22289/find-newest-file-and-its-modification-time/</link>
<description><![CDATA[ <p>Find the most recently modified file in a directory tree and output its name and modification time.  Use index 8 or 10 instead of 9 for access and inode modification time, respectively (see perlfunc manual page - function stat).

This is great for deciding what directories to backup.</p> ]]></description>
<pubDate>Sun, 01 Nov 2009 13:25:08 GMT</pubDate>
<guid>http://snipplr.com/view/22289/find-newest-file-and-its-modification-time/</guid>
</item>
<item>
<title>(Bash) Cygwin: recursive copy with ACLs</title>
<link>http://snipplr.com/view/21820/cygwin-recursive-copy-with-acls/</link>
<description><![CDATA[ <p>Cygwin's `cp` discards ACLs (complex windoze permissions).  You have to copy them separately as follows:</p> ]]></description>
<pubDate>Sun, 25 Oct 2009 12:23:47 GMT</pubDate>
<guid>http://snipplr.com/view/21820/cygwin-recursive-copy-with-acls/</guid>
</item>
<item>
<title>(Bash) Convert bit stream to ASCII text</title>
<link>http://snipplr.com/view/20493/convert-bit-stream-to-ascii-text/</link>
<description><![CDATA[ <p>Useful for decoding geek humour such as [this cartoon](http://assets.comics.com/dyn/str_strip/000000000/00000000/0000000/200000/90000/5000/900/295942/295942.full.gif).  Accepts input from stdin.</p> ]]></description>
<pubDate>Wed, 30 Sep 2009 16:03:09 GMT</pubDate>
<guid>http://snipplr.com/view/20493/convert-bit-stream-to-ascii-text/</guid>
</item>
<item>
<title>(Ruby) Ruby class + method documentation</title>
<link>http://snipplr.com/view/20490/ruby-class--method-documentation/</link>
<description><![CDATA[ <p>The shell command which provides documentation for Ruby's classes and methods is:</p> ]]></description>
<pubDate>Wed, 30 Sep 2009 15:50:14 GMT</pubDate>
<guid>http://snipplr.com/view/20490/ruby-class--method-documentation/</guid>
</item>
<item>
<title>(Regular Expression) Zero version numbers to clone Cygwin installation</title>
<link>http://snipplr.com/view/20488/zero-version-numbers-to-clone-cygwin-installation/</link>
<description><![CDATA[ <p>A Cygwin installation can be cloned by copying `/etc/setup/installed.db` and zeroing all version numbers, then running the installation utility.  The following `sed` script will set the version of most packages to zero.  Some non-standard version numbers will not be affected and have to be zeroed by hand.</p> ]]></description>
<pubDate>Wed, 30 Sep 2009 15:35:28 GMT</pubDate>
<guid>http://snipplr.com/view/20488/zero-version-numbers-to-clone-cygwin-installation/</guid>
</item>
<item>
<title>(Bash) Get / set CPU affinity (Linux)</title>
<link>http://snipplr.com/view/19878/get--set-cpu-affinity-linux/</link>
<description><![CDATA[ <p>Start jobs bound to certain CPU(s), or find the number of available CPUs.</p> ]]></description>
<pubDate>Thu, 17 Sep 2009 15:38:09 GMT</pubDate>
<guid>http://snipplr.com/view/19878/get--set-cpu-affinity-linux/</guid>
</item>
</channel>
</rss>