<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - dom111</title>
<link>http://snipplr.com/users/dom111</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sat, 25 May 2013 00:25:37 GMT</pubDate>
<item>
<title>(PHP) php-log - Process log files with PHP</title>
<link>http://snipplr.com/view/40524/phplog--process-log-files-with-php/</link>
<description><![CDATA[ <p>I’ve recently had to quickly parse an Apache log file, to get basic usage statistics for a site over a month and wanted the ability to quickly process any general logs and store them in a MySQL table, so I’ve made a small package class.log.

Included in the package are:

class.log.php (the main class)
class.log.processor.php (an interface for a log processor, very basic!!)
class.log.output.php (a simple extension of the processor (outputs  tags with s)
class.log.mysql.php (a simple mysql importer of the processed data)
parse.php (a simple implementation, bringing all the classes together)
The class is designed to use one line at a time from the log retrieved, and the regular expression specified in class.log.php can be modified to parse different types of logs as long as the matches array is also updated.

I’ve only used this for apache logs currently, which it managed quite well, I’m not sure if I’d use this script in an automated script, but I’ll leave that for you to decide.</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 20:07:44 GMT</pubDate>
<guid>http://snipplr.com/view/40524/phplog--process-log-files-with-php/</guid>
</item>
<item>
<title>(PHP) chunk - Break A Large XML File Into Manageable Chunks</title>
<link>http://snipplr.com/view/40523/chunk--break-a-large-xml-file-into-manageable-chunks/</link>
<description><![CDATA[ <p>I’ve recently had to parse some pretty large XML documents, and needed a method to read one element at a time.

Here’s a fairly simple solution in PHP.</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 20:02:15 GMT</pubDate>
<guid>http://snipplr.com/view/40523/chunk--break-a-large-xml-file-into-manageable-chunks/</guid>
</item>
<item>
<title>(Ruby) chunk - break a large XML file into manageable chunks</title>
<link>http://snipplr.com/view/40522/chunk--break-a-large-xml-file-into-manageable-chunks/</link>
<description><![CDATA[ <p>I’ve recently had to parse some pretty large XML documents, and needed a method to read one element at a time.

Here’s a fairly simple solution in Ruby form.</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 20:01:04 GMT</pubDate>
<guid>http://snipplr.com/view/40522/chunk--break-a-large-xml-file-into-manageable-chunks/</guid>
</item>
<item>
<title>(jQuery) jQuery Parallax</title>
<link>http://snipplr.com/view/40521/jquery-parallax/</link>
<description><![CDATA[ <p>I’ve seen some very cool parallax effect around lately, especially liking the Silverback site. But none of them are particularly interactive, so I thought I’d make a small implementation of the Parallax effect that interacts with the mouse.

Very early stages (and I haven’t tested it on IE yet… but you could just you conditional comments to exclude ‘those’ people anyway…) but it seems to be working ok. The options aren’t really simple, but they should be fairly self-explanatory…</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 19:57:52 GMT</pubDate>
<guid>http://snipplr.com/view/40521/jquery-parallax/</guid>
</item>
<item>
<title>(jQuery) jQuery addCaptions</title>
<link>http://snipplr.com/view/40520/jquery-addcaptions/</link>
<description><![CDATA[ <p>A simple script that will add captions to images and allow for easy styling.</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 19:56:03 GMT</pubDate>
<guid>http://snipplr.com/view/40520/jquery-addcaptions/</guid>
</item>
<item>
<title>(PHP) Object Oriented Image Manipulation</title>
<link>http://snipplr.com/view/40519/object-oriented-image-manipulation/</link>
<description><![CDATA[ <p>I’ve been working on a CMS lately and having to create thumbnails for uploaded images is always a pain, lots of maths working out the correct sizes and such, so I’ve created a fairly small script to manipulate images in an object-oriented style.</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 19:54:04 GMT</pubDate>
<guid>http://snipplr.com/view/40519/object-oriented-image-manipulation/</guid>
</item>
<item>
<title>(jQuery) jQuery Message</title>
<link>http://snipplr.com/view/40518/jquery-message/</link>
<description><![CDATA[ <p>Recently I’ve seen a few implementation of Growl in Javascript and basically just thought I’d have a go too. Everyone’s doing it, or so it seems!

This simple implementation is styled using pure CSS and you should be to easily modify it to suit your needs!</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 19:52:05 GMT</pubDate>
<guid>http://snipplr.com/view/40518/jquery-message/</guid>
</item>
<item>
<title>(JavaScript) mootools dropdownify</title>
<link>http://snipplr.com/view/40517/mootools-dropdownify/</link>
<description><![CDATA[ <p>So recently I was asked to change a navigation style of an existing site to drop-down menus.

Simple, I thought, just use one of the many existing drop-down plugins. I tried many, but most seemed to use hardcoded styles and I had a few problems (some of which I encountered again, writing this).

So I’ve made this, I think it’s fairly robust, but I’m sure there’ll be problems with embedded objects (flash) and select boxes (in </p> ]]></description>
<pubDate>Wed, 15 Sep 2010 19:50:05 GMT</pubDate>
<guid>http://snipplr.com/view/40517/mootools-dropdownify/</guid>
</item>
<item>
<title>(jQuery) jQuery - Dropdownify</title>
<link>http://snipplr.com/view/40516/jquery--dropdownify/</link>
<description><![CDATA[ <p>So recently I was asked to change a navigation style of an existing site to drop-down menus.

Simple, I thought, just use one of the many existing drop-down plugins. I tried many, but most seemed to use hardcoded styles and I had a few problems (some of which I encountered again, writing this).

So I’ve made this, I think it’s fairly robust, but I’m sure there’ll be problems with embedded objects (flash) and select boxes (in </p> ]]></description>
<pubDate>Wed, 15 Sep 2010 19:48:53 GMT</pubDate>
<guid>http://snipplr.com/view/40516/jquery--dropdownify/</guid>
</item>
<item>
<title>(JavaScript) autoPopulate 0.1 - Automatically populate form fields using a bookmarklet</title>
<link>http://snipplr.com/view/40515/autopopulate-01--automatically-populate-form-fields-using-a-bookmarklet/</link>
<description><![CDATA[ <p>I\'m constantly testing forms over and over for one reason or another, and am fed up with making a typo and autocomplete not populating all the data, so I made this little snippet. It searches for form elements on the page (input, textarea and select) and using regular expressions, tries to match the field name and populate the data as best it can. There\'s also a generator so instead of the random test data I\'ve provided you can generate your own.\r\n\r\nDemo:\r\n[http://www.dom111.co.uk/files/autoPopulate/](http://www.dom111.co.uk/files/autoPopulate/)\r\n\r\nGenerator:\r\n[http://www.dom111.co.uk/files/autoPopulate/generate.html](http://www.dom111.co.uk/files/autoPopulate/generate.html)</p> ]]></description>
<pubDate>Wed, 15 Sep 2010 19:42:07 GMT</pubDate>
<guid>http://snipplr.com/view/40515/autopopulate-01--automatically-populate-form-fields-using-a-bookmarklet/</guid>
</item>
<item>
<title>(PHP) xmlentnties and xml_entitiy_decode</title>
<link>http://snipplr.com/view/28349/xmlentnties-and-xmlentitiydecode/</link>
<description><![CDATA[ <p>Because htmlentities just doesn't cut it.

Recently needed this to work with 3rd part software, ended up having to make it pretty robust so thought I'd share!</p> ]]></description>
<pubDate>Mon, 15 Feb 2010 15:44:12 GMT</pubDate>
<guid>http://snipplr.com/view/28349/xmlentnties-and-xmlentitiydecode/</guid>
</item>
<item>
<title>(JavaScript) JSS 0.1 - Nested CSS using Javascript</title>
<link>http://snipplr.com/view/14629/jss-01--nested-css-using-javascript/</link>
<description><![CDATA[ <p>Ever wanted nested stylesheets?

I have!

Now you can have them! If you code your stylesheets as JSON and parse them using JSS 0.1. You could have the following:

      JSS({
        'html': {
          'body': {
            background: '#fff',
 
            'div#header': {
              height: '100px',
              background: '#00f'
            },
 
            'div#footer': {
              height: '40px',
 
              'span#copyright': {
                color: '#0f0'
              },
              'span#testing': {
                color: 'black',
                background: '#eeccff'
              }
            }
          },
          width: '800px'
        }
      });
Turned into:

      html {
        width: 800px;
      }
 
      html body {
        background: #fff;
      }
 
      html body div#header {
        height: 100px;
        background: #00f;
      }
 
      html body div#footer {
        height: 40px;
      }
 
      html body div#footer span#copyright {
        color: #0f0;
      }
 
      html body div#footer span#testing {
        color: black;
        background: #eeccff;
      }

Check out the blog post for a demo and a zip file containing the demo, full version and minified version.</p> ]]></description>
<pubDate>Fri, 01 May 2009 11:30:57 GMT</pubDate>
<guid>http://snipplr.com/view/14629/jss-01--nested-css-using-javascript/</guid>
</item>
<item>
<title>(JavaScript) Webkit (Safari) - Speed Dial bookmarklet</title>
<link>http://snipplr.com/view/11154/webkit-safari--speed-dial-bookmarklet/</link>
<description><![CDATA[ <p>A bookmarklet that enabled a speed dial storing the data in webkit's SQL engine. There are bugs and a few conditions, read: [http://www.dom111.co.uk/blog/coding/webkit-speed-dial-bookmarklet/59](http://www.dom111.co.uk/blog/coding/webkit-speed-dial-bookmarklet/59) for more information.</p> ]]></description>
<pubDate>Tue, 13 Jan 2009 20:27:31 GMT</pubDate>
<guid>http://snipplr.com/view/11154/webkit-safari--speed-dial-bookmarklet/</guid>
</item>
<item>
<title>(JavaScript) submitEvents - Javascript form submission handler</title>
<link>http://snipplr.com/view/7865/submitevents--javascript-form-submission-handler/</link>
<description><![CDATA[ <p>Requires Mootools 1.2
http://mootools.net/download

Based on the mootools javascript framework a re-usable class for easily implementing an array of on submit events.

* Confirmation - Provides an Ok, Cancel input box before proceeding further
* Submit Button - Disable and change the text on a submit button
* Information Div - Display a div that lets the user know something is happening
* Undo - Undo the changes (re-enable a previously disabled submit button, change the information div) that have been carried out by the class
* AJAX - Submit the form using AJAX instead of the ‘old fashioned’ way

This work is released under the creative commons share alike license.

Requires Mootools 1.2
http://mootools.net/download</p> ]]></description>
<pubDate>Wed, 13 Aug 2008 21:10:57 GMT</pubDate>
<guid>http://snipplr.com/view/7865/submitevents--javascript-form-submission-handler/</guid>
</item>
<item>
<title>(PHP) PHP - Lightweight Database and Rowset class, ActiveRecord style functions</title>
<link>http://snipplr.com/view/7468/php--lightweight-database-and-rowset-class-activerecord-style-functions/</link>
<description><![CDATA[ <p>Been wanting to made one of these for a while and finally I got round to it.

For some examples please visit the post:
http://www.dom111.co.uk/blog/coding/db/8

Any comments suggestions appreciated.
CreativeCommons ShareAlike</p> ]]></description>
<pubDate>Wed, 23 Jul 2008 18:59:13 GMT</pubDate>
<guid>http://snipplr.com/view/7468/php--lightweight-database-and-rowset-class-activerecord-style-functions/</guid>
</item>
</channel>
</rss>