<?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/easy</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 07 Sep 2008 18:13:53 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>(Bash) tar basics</title>
<link>http://snipplr.com/view/7399/tar-basics/</link>
<description><![CDATA[ <p>You would think I'd have this memorized by now, but no.</p> ]]></description>
<pubDate>Sat, 19 Jul 2008 12:29:59 GMT</pubDate>
<guid>http://snipplr.com/view/7399/tar-basics/</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>(Bash) Count the number of files in a directory</title>
<link>http://snipplr.com/view/4453/count-the-number-of-files-in-a-directory/</link>
<description><![CDATA[ <p>How many files are in the current working directory?  This is recursive, so the count includes subdirectories and files contained in subdirectories.  To get a non-recursive count of just the files/directories in the current working directory, use ls -1 in place of find .</p> ]]></description>
<pubDate>Thu, 03 Jan 2008 22:21:06 GMT</pubDate>
<guid>http://snipplr.com/view/4453/count-the-number-of-files-in-a-directory/</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) How to start CPAN on Windows/ActivePerl</title>
<link>http://snipplr.com/view/3718/how-to-start-cpan-on-windowsactiveperl/</link>
<description><![CDATA[ <p>ActivePerl has a great package manager utility -- just type "ppm" at the prompt.

The problem is that ActivePerl's PPM points to ActivePerl's package repository, which doesn't contain every module listed on CPAN.

The solution is to invoke the cpan utility under windows!  Here's how.</p> ]]></description>
<pubDate>Mon, 17 Sep 2007 10:23:37 GMT</pubDate>
<guid>http://snipplr.com/view/3718/how-to-start-cpan-on-windowsactiveperl/</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>(Perl) Grab linked files from a list of web pages</title>
<link>http://snipplr.com/view/3126/grab-linked-files-from-a-list-of-web-pages/</link>
<description><![CDATA[ <p>Expects as argument the name of a file containing a newline-delimited list of URLs.  When invoked, launches an interactive shell that asks what type of file should be downloaded.  Then downloads all the files that are linked from each of the listed Web pages.</p> ]]></description>
<pubDate>Tue, 03 Jul 2007 22:31:30 GMT</pubDate>
<guid>http://snipplr.com/view/3126/grab-linked-files-from-a-list-of-web-pages/</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>
<item>
<title>(JavaScript) infinite loop alert</title>
<link>http://snipplr.com/view/2848/infinite-loop-alert/</link>
<description><![CDATA[ <p>just some goofy code ^.^</p> ]]></description>
<pubDate>Tue, 12 Jun 2007 04:40:27 GMT</pubDate>
<guid>http://snipplr.com/view/2848/infinite-loop-alert/</guid>
</item>
<item>
<title>(JavaScript) Does an object have a specific property?</title>
<link>http://snipplr.com/view/2708/does-an-object-have-a-specific-property/</link>
<description><![CDATA[ <p>This is a very easy way to check if an object has a given property.  Easier than checking if (obj.foo != null) or some such, which is what I've been doing :(  From Flanagan, 5th ed, p. 108.; but I actually ran across it in the source of this page: http://www.gtalbot.org/DHTMLSection/DynamicOpacity.html, thanks to Gerard Talbot on clj.</p> ]]></description>
<pubDate>Thu, 24 May 2007 09:24:08 GMT</pubDate>
<guid>http://snipplr.com/view/2708/does-an-object-have-a-specific-property/</guid>
</item>
<item>
<title>(JavaScript) Calculate net paycheck</title>
<link>http://snipplr.com/view/2517/calculate-net-paycheck/</link>
<description><![CDATA[ <p>Given my base pay and an optional pre-tax 401k contribution percentage, calculate my net pay.  Assumes US income tax of 27%.  All results will be approximate (the browser is not a reliable calculator)!</p> ]]></description>
<pubDate>Mon, 23 Apr 2007 14:01:42 GMT</pubDate>
<guid>http://snipplr.com/view/2517/calculate-net-paycheck/</guid>
</item>
</channel>
</rss>