<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 05:57:15 +0000</lastBuildDate>
    <item>
      <title>(jQuery) iPad/iPhone Orientation Body Class - iridium</title>
      <link>https://snipplr.com/view/61898/ipadiphone-orientation-body-class</link>
      <description>&lt;p&gt;This function will detect the orientation (portrait/landscape) of an iOS device and set the body class to either portrait or landscape, as well as providing a global variable for use elsewhere in your JS.&#13;
&#13;
If you require multiple classes on your body tag, simply alter the code to use jQuery's addClass() and removeClass() functions.&lt;/p&gt;</description>
      <pubDate>Thu, 15 Dec 2011 03:33:05 UTC</pubDate>
      <guid>https://snipplr.com/view/61898/ipadiphone-orientation-body-class</guid>
    </item>
    <item>
      <title>(PHP) Calculate Paypal Fee - iridium</title>
      <link>https://snipplr.com/view/44373/calculate-paypal-fee</link>
      <description>&lt;p&gt;This calculates the Paypal transaction fee for a supplied amount, and adds it to the final amount. We used this to charge the Paypal fee back to the user as a booking fee on ticket sales for an event.&#13;
&#13;
The function will spit out an array containing:&#13;
*   The Sub Total amount supplied as sub_total&#13;
*   The Paypal Fee applied as paypal_fee&#13;
*   The Grand Total, which is the two above added together, as grand_total&#13;
&#13;
You have the option of rounding the fee up to the nearest whole number, or charging the user the exact transaction fee, just supply a second parameter in the function call as true.&#13;
&#13;
The Paypal rates are set as variables inside the function itself, it's up to you to check what they are for your country and set them accordingly.&lt;/p&gt;</description>
      <pubDate>Thu, 18 Nov 2010 23:11:30 UTC</pubDate>
      <guid>https://snipplr.com/view/44373/calculate-paypal-fee</guid>
    </item>
    <item>
      <title>(PHP) Year List Select Box - iridium</title>
      <link>https://snipplr.com/view/14466/year-list-select-box</link>
      <description>&lt;p&gt;Generates an options list of years for a select box, going from current year backwards through the number of years specified in the first variable.&#13;
&#13;
Useful for birthday fields on signup forms.&#13;
&#13;
eg. 2009, 2008, 2007, 2006 ... 1912, 1911, 1910, 1909&#13;
&#13;
EDITED: Now includes option to set the initially selected value to a set number of years ago. Useful if your form is targetted at a certain age group. Will default to current year if set to '0'.&lt;/p&gt;</description>
      <pubDate>Mon, 27 Apr 2009 05:15:51 UTC</pubDate>
      <guid>https://snipplr.com/view/14466/year-list-select-box</guid>
    </item>
    <item>
      <title>(PHP) Get Apache Version - iridium</title>
      <link>https://snipplr.com/view/10881/get-apache-version</link>
      <description>&lt;p&gt;Return just the Apache version number of your server, and operating system, from $_SERVER['SERVER_SOFTWARE']&#13;
&#13;
Example: &#13;
&#13;
print ('Apache Version: ' . apacheversion());&#13;
&#13;
will return something along the lines of...&#13;
&#13;
"Apache Version: 2.2.10 (Unix)"&lt;/p&gt;</description>
      <pubDate>Sat, 03 Jan 2009 16:57:42 UTC</pubDate>
      <guid>https://snipplr.com/view/10881/get-apache-version</guid>
    </item>
    <item>
      <title>(PHP) Single MySQL Result - iridium</title>
      <link>https://snipplr.com/view/10880/single-mysql-result</link>
      <description>&lt;p&gt;Simple but useful function for getting a single piece of data from a database and placing it straight into a variable.&#13;
&#13;
Example:&#13;
$variable = one_result("SELECT columnOne FROM table WHERE columnTwo=whatever");&#13;
&#13;
This would insert the value of columnOne where columnTwo is 'whatever' into $variable&lt;/p&gt;</description>
      <pubDate>Sat, 03 Jan 2009 16:42:08 UTC</pubDate>
      <guid>https://snipplr.com/view/10880/single-mysql-result</guid>
    </item>
  </channel>
</rss>
