<?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/basic</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Mon, 08 Sep 2008 06:03:47 GMT</pubDate>
<item>
<title>(Bash) Alias a command and save it in .profile</title>
<link>http://snipplr.com/view/7400/alias-a-command-and-save-it-in-profile/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 19 Jul 2008 13:03:50 GMT</pubDate>
<guid>http://snipplr.com/view/7400/alias-a-command-and-save-it-in-profile/</guid>
</item>
<item>
<title>(JavaScript) Conditionally assign a value to a variable</title>
<link>http://snipplr.com/view/6850/conditionally-assign-a-value-to-a-variable/</link>
<description><![CDATA[ <p>To assign a value to a variable only if some expression evaluates to true, I would usually do this:

var foo;
if (condition){
    foo = "success";
}


This is Douglas Crockford's idiom and it shortens the above from 4 lines to 1.

I have understood for a while that (expr1 &amp;&amp; expr2) evaluates to truth only if both conditions are true.  What I did not get before Crockford pointed it out in his book, was that &amp;&amp; doesn't simply return a boolean value -- it returns the result of the last expression that was evaluated.

So if both expressions evaluate to false, the result of first expression will be returned.  If only one expression evaluates true, the result of the false expression will be returned.  And if both expressions evaluate to truth, the result of the second expression is returned.</p> ]]></description>
<pubDate>Mon, 23 Jun 2008 08:44:59 GMT</pubDate>
<guid>http://snipplr.com/view/6850/conditionally-assign-a-value-to-a-variable/</guid>
</item>
<item>
<title>(JavaScript) List all IDs in the DOM tree</title>
<link>http://snipplr.com/view/6487/list-all-ids-in-the-dom-tree/</link>
<description><![CDATA[ <p>List all the IDs on the page.</p> ]]></description>
<pubDate>Wed, 28 May 2008 17:27:18 GMT</pubDate>
<guid>http://snipplr.com/view/6487/list-all-ids-in-the-dom-tree/</guid>
</item>
<item>
<title>(Perl) pod</title>
<link>http://snipplr.com/view/4885/pod/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sun, 03 Feb 2008 15:50:04 GMT</pubDate>
<guid>http://snipplr.com/view/4885/pod/</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>(Perl) starter Perl module</title>
<link>http://snipplr.com/view/3136/starter-perl-module/</link>
<description><![CDATA[ <p>Put this in the file MyPackage.pm, and call it with Use::MyPackage</p> ]]></description>
<pubDate>Tue, 03 Jul 2007 23:04:21 GMT</pubDate>
<guid>http://snipplr.com/view/3136/starter-perl-module/</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>(Lisp) load an external file</title>
<link>http://snipplr.com/view/2933/load-an-external-file/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 18 Jun 2007 20:48:42 GMT</pubDate>
<guid>http://snipplr.com/view/2933/load-an-external-file/</guid>
</item>
</channel>
</rss>