<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/pattern</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Tue, 21 May 2013 00:32:47 GMT</pubDate>
<item>
<title>(Bash) Bash pattern matching using extended globbing - symsec</title>
<link>http://snipplr.com/view/67845/bash-pattern-matching-using-extended-globbing/</link>
<description><![CDATA[ <p>Using a (faster) case structure to do bash built-in pattern matching. See [Bash hackers](http://wiki.bash-hackers.org/syntax/pattern) for more information. Thanks to [gnashley](http://www.linuxquestions.org/questions/programming-9/bash-search-for-a-pattern-within-a-string-variable-448022/#post4261310) for the snippet.</p> ]]></description>
<pubDate>Sat, 20 Oct 2012 20:07:08 GMT</pubDate>
<guid>http://snipplr.com/view/67845/bash-pattern-matching-using-extended-globbing/</guid>
</item>
<item>
<title>(JavaScript) JavaScript Basic Decorator Pattern - timsommer</title>
<link>http://snipplr.com/view/66521/javascript-basic-decorator-pattern/</link>
<description><![CDATA[ <p>In this section we're going to explore the decorator - a structural design pattern that promotes code reuse and is a flexible alternative to subclassing. This pattern is also useful for modifying existing systems where you may wish to add additional features to objects without the need to change the underlying code that uses them. 

Traditionally, the decorator is defined as a design pattern that allows behavior to be added to an existing object dynamically. The idea is that the decoration itself isn't essential to the base functionality of an object otherwise it would be baked into the 'superclass' object itself.</p> ]]></description>
<pubDate>Fri, 03 Aug 2012 18:49:50 GMT</pubDate>
<guid>http://snipplr.com/view/66521/javascript-basic-decorator-pattern/</guid>
</item>
<item>
<title>(JavaScript) Javascript Singleton Pattern - timsommer</title>
<link>http://snipplr.com/view/66421/javascript-singleton-pattern/</link>
<description><![CDATA[ <p>In conventional software engineering, the singleton pattern can be implemented by
creating a class with a method that creates a new instance of the class if one doesn't exist. In the event of an instance already existing, it simply returns a reference to that object.</p> ]]></description>
<pubDate>Mon, 30 Jul 2012 21:28:49 GMT</pubDate>
<guid>http://snipplr.com/view/66421/javascript-singleton-pattern/</guid>
</item>
<item>
<title>(CSS) Transparent Background Pattern - shangle</title>
<link>http://snipplr.com/view/65431/transparent-background-pattern/</link>
<description><![CDATA[ <p>adds a checkered background to images, so images with transparency are revealed.

based upon: http://lea.verou.me/css3patterns/#checkerboard</p> ]]></description>
<pubDate>Thu, 07 Jun 2012 01:12:39 GMT</pubDate>
<guid>http://snipplr.com/view/65431/transparent-background-pattern/</guid>
</item>
<item>
<title>(PHP) php color-scheme viewer - DanielFGray</title>
<link>http://snipplr.com/view/60373/php-colorscheme-viewer/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 31 Oct 2011 16:41:52 GMT</pubDate>
<guid>http://snipplr.com/view/60373/php-colorscheme-viewer/</guid>
</item>
<item>
<title>(JavaScript) Mediator pattern (HB Stone) - ultranaut</title>
<link>http://snipplr.com/view/60350/mediator-pattern-hb-stone/</link>
<description><![CDATA[ <p>Somewhat tweaked</p> ]]></description>
<pubDate>Sun, 30 Oct 2011 12:15:40 GMT</pubDate>
<guid>http://snipplr.com/view/60350/mediator-pattern-hb-stone/</guid>
</item>
<item>
<title>(JavaScript) JS sandbox pattern implementation - ultranaut</title>
<link>http://snipplr.com/view/60088/js-sandbox-pattern-implementation/</link>
<description><![CDATA[ <p>http://stackoverflow.com/questions/3628649/javascript-self-contained-sandbox-events-and-client-side-stack</p> ]]></description>
<pubDate>Sun, 23 Oct 2011 13:54:27 GMT</pubDate>
<guid>http://snipplr.com/view/60088/js-sandbox-pattern-implementation/</guid>
</item>
<item>
<title>(ActionScript 3) sunflower pattern - hejaaa</title>
<link>http://snipplr.com/view/57547/sunflower-pattern/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 03 Aug 2011 05:08:55 GMT</pubDate>
<guid>http://snipplr.com/view/57547/sunflower-pattern/</guid>
</item>
<item>
<title>(JavaScript) Fresh JavaScript file (With namespaced, closured module pattern) - geekyjohn</title>
<link>http://snipplr.com/view/57085/fresh-javascript-file-with-namespaced-closured-module-pattern/</link>
<description><![CDATA[ <p>A JavaScript starter with a namespace and closure</p> ]]></description>
<pubDate>Sun, 24 Jul 2011 22:35:21 GMT</pubDate>
<guid>http://snipplr.com/view/57085/fresh-javascript-file-with-namespaced-closured-module-pattern/</guid>
</item>
<item>
<title>(Python) Google Scraper - eristoddle</title>
<link>http://snipplr.com/view/56087/google-scraper/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 04 Jul 2011 18:11:33 GMT</pubDate>
<guid>http://snipplr.com/view/56087/google-scraper/</guid>
</item>
<item>
<title>(JavaScript) Javascript revealing module pattern template - coprolit</title>
<link>http://snipplr.com/view/50765/javascript-revealing-module-pattern-template/</link>
<description><![CDATA[ <p>"Javascript module pattern emulates the concept of classes in such a way that we're able to include both public/private methods and variables inside a single object, thus shielding/namespacing particular parts from the global scope."
When inheritance is not needed and a only few instances is needed (Keep in mind that each instance places a new copy of each function in memory!)</p> ]]></description>
<pubDate>Thu, 17 Mar 2011 08:40:45 GMT</pubDate>
<guid>http://snipplr.com/view/50765/javascript-revealing-module-pattern-template/</guid>
</item>
<item>
<title>(HTML) Module pattern HTML - shodan_uk</title>
<link>http://snipplr.com/view/49276/module-pattern-html/</link>
<description><![CDATA[ <p>Authour: Mike Rumble (@rumble)</p> ]]></description>
<pubDate>Sun, 20 Feb 2011 07:13:47 GMT</pubDate>
<guid>http://snipplr.com/view/49276/module-pattern-html/</guid>
</item>
<item>
<title>(CSS) Super module CSS - shodan_uk</title>
<link>http://snipplr.com/view/49275/super-module-css/</link>
<description><![CDATA[ <p>Authour: Mike Rumble (@rumble)</p> ]]></description>
<pubDate>Sun, 20 Feb 2011 07:11:16 GMT</pubDate>
<guid>http://snipplr.com/view/49275/super-module-css/</guid>
</item>
<item>
<title>(HTML) Simple module HTML pattern - shodan_uk</title>
<link>http://snipplr.com/view/49108/simple-module-html-pattern/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 17 Feb 2011 03:54:32 GMT</pubDate>
<guid>http://snipplr.com/view/49108/simple-module-html-pattern/</guid>
</item>
<item>
<title>(JavaScript) A design pattern? - nerdfiles</title>
<link>http://snipplr.com/view/35318/a-design-pattern/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 29 May 2010 14:43:37 GMT</pubDate>
<guid>http://snipplr.com/view/35318/a-design-pattern/</guid>
</item>
<item>
<title>(ActionScript 3) AS3 Get Flash Player Version Number (inc. Major and Minor Numbers) - adrianparr</title>
<link>http://snipplr.com/view/35260/as3-get-flash-player-version-number-inc-major-and-minor-numbers/</link>
<description><![CDATA[ <p>This code separates out the Flash Player Platform, Major Version number and Minor Version numbers.</p> ]]></description>
<pubDate>Thu, 27 May 2010 07:53:27 GMT</pubDate>
<guid>http://snipplr.com/view/35260/as3-get-flash-player-version-number-inc-major-and-minor-numbers/</guid>
</item>
<item>
<title>(JavaScript) Pattern replace String prototype - Pjotor</title>
<link>http://snipplr.com/view/33637/pattern-replace-string-prototype/</link>
<description><![CDATA[ <p>Quick and dirty pattern string replacer.
Usage:
"my {color} {fruit}".prep({ color: "red", fruit: "apple"})</p> ]]></description>
<pubDate>Fri, 30 Apr 2010 04:21:54 GMT</pubDate>
<guid>http://snipplr.com/view/33637/pattern-replace-string-prototype/</guid>
</item>
<item>
<title>(ActionScript 3) AS3 Checks a String to see if it is a Valid Email Format - adrianparr</title>
<link>http://snipplr.com/view/33601/as3-checks-a-string-to-see-if-it-is-a-valid-email-format/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 29 Apr 2010 10:21:59 GMT</pubDate>
<guid>http://snipplr.com/view/33601/as3-checks-a-string-to-see-if-it-is-a-valid-email-format/</guid>
</item>
<item>
<title>(C#) IRepository using lambda expressions - bokkers</title>
<link>http://snipplr.com/view/27617/irepository-using-lambda-expressions/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 03 Feb 2010 08:31:51 GMT</pubDate>
<guid>http://snipplr.com/view/27617/irepository-using-lambda-expressions/</guid>
</item>
<item>
<title>(ActionScript 3) "Mini Strategy" pattern using namespaces - drukepple</title>
<link>http://snipplr.com/view/27439/mini-strategy-pattern-using-namespaces/</link>
<description><![CDATA[ <p>I sometimes use namespaces to implements a sort of "mini strategy pattern."

This starts to pay off when you have more than one method that needs to do different things depending on the "mode" (or strategy). You have your "which mode am I on?" logic in one place (`set mode`) and then each mode-dependent method simply utilizes the `currentMode::someMethod()` technique.

Not as fancy, robust, or strict as a proper strategy pattern with interfaces and strategy objects, but if you want to keep things sort of self-contained, have a small amount of strategies to consider, or don't want the end user to have to worry about creating the strategy objects, then I've found this useful.</p> ]]></description>
<pubDate>Sun, 31 Jan 2010 14:41:25 GMT</pubDate>
<guid>http://snipplr.com/view/27439/mini-strategy-pattern-using-namespaces/</guid>
</item>
</channel>
</rss>