<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BitBonsai Labs &#187; snippet</title>
	<atom:link href="http://www.bitbonsai.com/category/snippet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bitbonsai.com</link>
	<description>Mauricio Wolff&#039;s geekness</description>
	<lastBuildDate>Tue, 18 Oct 2011 12:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Mashup =  grooveshark + musicuo Bookmarklet</title>
		<link>http://www.bitbonsai.com/mashup-grooveshark-musicuo-bookmarklet/</link>
		<comments>http://www.bitbonsai.com/mashup-grooveshark-musicuo-bookmarklet/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 12:45:55 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=274</guid>
		<description><![CDATA[javascript:$&#40;'#banner'&#41;.remove&#40;&#41;; $&#40;'#top, #player'&#41;.width&#40;'auto'&#41;;$&#40;'#capital'&#41;.hide&#40;&#41;; $&#40;'#application'&#41;.css&#40;'margin-right',0&#41;;$&#40;window&#41;.trigger&#40;'resize'&#41;; &#160;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#banner'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#top, #player'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'auto'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#capital'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#application'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'margin-right'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">trigger</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resize'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/mashup-grooveshark-musicuo-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>musicuo Bookmarklet</title>
		<link>http://www.bitbonsai.com/musicuo-bookmarklet/</link>
		<comments>http://www.bitbonsai.com/musicuo-bookmarklet/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 11:15:34 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=261</guid>
		<description><![CDATA[javascript:$&#40;'#banner'&#41;.remove&#40;&#41;; $&#40;'#top, #player'&#41;.width&#40;'auto'&#41;;$&#40;window&#41;.trigger&#40;'resize'&#41;;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#banner'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#top, #player'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'auto'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">trigger</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resize'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/musicuo-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grooveshark&#8217;s bookmarklet</title>
		<link>http://www.bitbonsai.com/groovesharks-bookmarklet/</link>
		<comments>http://www.bitbonsai.com/groovesharks-bookmarklet/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 00:18:59 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=254</guid>
		<description><![CDATA[javascript:$&#40;'#capital'&#41;.hide&#40;&#41;;$&#40;'#application'&#41;.css&#40;'margin-right',0&#41;;$&#40;window&#41;.trigger&#40;'resize'&#41;;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#capital'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#application'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'margin-right'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">trigger</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resize'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/groovesharks-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Shadows and Glows&#8230;</title>
		<link>http://www.bitbonsai.com/css-shadows-and-glows/</link>
		<comments>http://www.bitbonsai.com/css-shadows-and-glows/#comments</comments>
		<pubDate>Fri, 13 May 2011 12:33:56 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=247</guid>
		<description><![CDATA[.shadow &#123; &#160; box-shadow: 0px 0px 6px rgba&#40;0,0,0,0.3&#41;; -webkit-box-shadow: 0px 0px 6px rgba&#40;0,0,0,0.3&#41;; -moz-box-shadow: 0px 0px 6px rgba&#40;0,0,0,0.3&#41;; -webkit-transition-duration: 0.2s; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; margin-bottom: 20px; &#125; &#160; .shadow:hover &#123; box-shadow: 0px 0px 20px rgba&#40;0,235,255,0.8&#41;; -webkit-box-shadow: 0px 0px 20px rgba&#40;0,235,255,0.8&#41;; -moz-box-shadow: 0px 0px 20px rgba&#40;0,235,255,0.8&#41;; &#125;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.shadow</span> <span style="color: #00AA00;">&#123;</span>
&nbsp;
box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">6px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">6px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">6px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.3</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-webkit-transition-duration<span style="color: #00AA00;">:</span> 0.2s<span style="color: #00AA00;">;</span>
-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.shadow</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">20px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">235</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.8</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">20px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">235</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.8</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">20px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">235</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.8</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/css-shadows-and-glows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing pastie.org embed</title>
		<link>http://www.bitbonsai.com/testing-pastie-org-embed/</link>
		<comments>http://www.bitbonsai.com/testing-pastie-org-embed/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 12:25:05 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=229</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script src='http://pastie.org/1023253.js'></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/testing-pastie-org-embed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JS Tip: Revealing Module Pattern</title>
		<link>http://www.bitbonsai.com/revealing-module-pattern/</link>
		<comments>http://www.bitbonsai.com/revealing-module-pattern/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 17:59:00 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[snippet]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=217</guid>
		<description><![CDATA[From Christian Heilmann. Nothing too fancy for those who are used to write jQ plugins, but nice to save it for reference&#8230; var myApp = function&#40;&#41;&#123; var nome = 'Mauricio Wolff'; var idade = 35; &#160; function insertPessoa&#40;&#41;&#123; // [...] &#125; &#160; function updatePessoa&#40;&#41;&#123; // [...] &#125; &#160; function setPessoa &#40;&#41; &#123; // [ usa [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>From Christian Heilmann. Nothing too fancy for those who are used to write jQ plugins, but nice to save it for reference&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myApp <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> nome <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Mauricio Wolff'</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> idade <span style="color: #339933;">=</span> <span style="color: #CC0000;">35</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">function</span> insertPessoa<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// [...]</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">function</span> updatePessoa<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// [...]</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">function</span> setPessoa <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// [ usa insert ou update ]</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">function</span> getPessoa <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// [...]</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">return</span><span style="color: #009900;">&#123;</span>
		set<span style="color: #339933;">:</span> setPessoa<span style="color: #339933;">,</span>
		get<span style="color: #339933;">:</span> getPessoa
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Example usage:</span>
myApp.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/revealing-module-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python x PHP: Finding IPs with regex</title>
		<link>http://www.bitbonsai.com/python-php-vs-find-ip-with-regex/</link>
		<comments>http://www.bitbonsai.com/python-php-vs-find-ip-with-regex/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 12:09:47 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=147</guid>
		<description><![CDATA[Sometimes I just like to write code in Python and PHP to compare them, and admire both&#8230; Here&#8217;s a little code to find IP adressess inside strings (returned from a nslookup). The code is not optimal, but illustrate how both languages works. Just for some friday fun&#8230; Python &#160; Python 2.6.1 &#40;r261:67515, Jul  7 2009, [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I just like to write code in Python and PHP to compare them, and admire both&#8230;</p>
<p>Here&#8217;s a little code to find IP adressess inside strings (returned from a nslookup). The code is not optimal, but illustrate how both languages works. Just for some friday fun&#8230;</p>
<h3>Python</h3>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">&nbsp;
Python 2.6.1 <span style="color: black;">&#40;</span>r261:<span style="color: #ff4500;">67515</span>, Jul  <span style="color: #ff4500;">7</span> <span style="color: #ff4500;">2009</span>,  <span style="color: #ff4500;">23</span>:<span style="color: #ff4500;">51</span>:<span style="color: #ff4500;">51</span><span style="color: black;">&#41;</span>
 <span style="color: black;">&#91;</span>GCC 4.2.1 <span style="color: black;">&#40;</span>Apple Inc. <span style="color: black;">build</span> <span style="color: #ff4500;">5646</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span> on darwin
 Type <span style="color: #483d8b;">&quot;help&quot;</span>, <span style="color: #483d8b;">&quot;copyright&quot;</span>, <span style="color: #483d8b;">&quot;credits&quot;</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #483d8b;">&quot;license&quot;</span>  <span style="color: #ff7700;font-weight:bold;">for</span>  more information.
&nbsp;
<span style="color: #66cc66;">&gt;&gt;&gt;</span> a  = <span style="color: #483d8b;">'yahoo.com IN A 69.147.114.224 18774s  (05:12:54)'</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> a += <span style="color: #483d8b;">'yahoo.com IN A 209.131.36.159 18774s  (05:12:54)'</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> a += <span style="color: #483d8b;">'yahoo.com IN A 209.191.93.53  18774s  (05:12:54)'</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> a
 <span style="color: #483d8b;">'yahoo.com IN A 69.147.114.224  18774s (05:12:54)yahoo.com IN A 209.131.36.159 18774s  (05:12:54)yahoo.com IN A 209.191.93.53  18774s (05:12:54)'</span>
<span style="color: #66cc66;">&gt;&gt;&gt;;</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> p = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'(?:<span style="color: #000099; font-weight: bold;">\d</span>{1,3}<span style="color: #000099; font-weight: bold;">\.</span>){3}<span style="color: #000099; font-weight: bold;">\d</span>{1,3}'</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;;</span> p.<span style="color: black;">findall</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
 <span style="color: black;">&#91;</span><span style="color: #483d8b;">'69.147.114.224'</span>, <span style="color: #483d8b;">'209.131.36.159'</span>,  <span style="color: #483d8b;">'209.191.93.53'</span><span style="color: black;">&#93;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span></pre></div></div>

<h3>PHP</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$a</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'yahoo.com IN A 69.147.114.224 18774s (05:12:54)'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'yahoo.com  IN A 209.131.36.159 18774s (05:12:54)'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'yahoo.com  IN A 209.191.93.53  18774s (05:12:54)'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">print</span> <span style="color: #000088;">$a</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
saida: yahoo.com IN A 69.147.114.224 18774s (05:12:54)yahoo.com IN A  209.131.36.159 18774s (05:12:54)yahoo.com IN A 209.191.93.53 18774s  (05:12:54)
*/</span>
&nbsp;
<span style="color: #000088;">$re</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/(\d+).(\d+).(\d+).(\d+)/'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$re</span><span style="color: #339933;">,</span> <span style="color: #000088;">$a</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// saida 1</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// saida 2</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
saida 1:
&nbsp;
array(3) {
  [0]=&gt;
  string(14) &quot;69.147.114.224&quot;
  [1]=&gt;
  string(14) &quot;209.131.36.159&quot;
  [2]=&gt;
  string(13) &quot;209.191.93.53&quot;
}
&nbsp;
saida 2:
&nbsp;
array(5) {
  [0]=&gt;
  array(3) {
    [0]=&gt;
    string(14) &quot;69.147.114.224&quot;
    [1]=&gt;
    string(14) &quot;209.131.36.159&quot;
    [2]=&gt;
    string(13) &quot;209.191.93.53&quot;
  }
  [1]=&gt;
  array(3) {
    [0]=&gt;
    string(2) &quot;69&quot;
    [1]=&gt;
    string(3) &quot;209&quot;
    [2]=&gt;
    string(3) &quot;209&quot;
  }
  [2]=&gt;
  array(3) {
    [0]=&gt;
    string(3) &quot;147&quot;
    [1]=&gt;
    string(3) &quot;131&quot;
    [2]=&gt;
    string(3) &quot;191&quot;
  }
  [3]=&gt;
  array(3) {
    [0]=&gt;
    string(3) &quot;114&quot;
    [1]=&gt;
    string(2) &quot;36&quot;
    [2]=&gt;
    string(2) &quot;93&quot;
  }
  [4]=&gt;
  array(3) {
    [0]=&gt;
    string(3) &quot;224&quot;
    [1]=&gt;
    string(3) &quot;159&quot;
    [2]=&gt;
    string(2) &quot;53&quot;
  }
}
*/</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/python-php-vs-find-ip-with-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Porque adoro jQuery</title>
		<link>http://www.bitbonsai.com/porque-adoro-jquery/</link>
		<comments>http://www.bitbonsai.com/porque-adoro-jquery/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 08:10:54 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[snippet]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=140</guid>
		<description><![CDATA[Pedido: Fazer com que todos os links de uma determinada página sejam externos. Abordagem 1: Alterar a classe em php, genérica, para ver se o link é externo e acrescentar o target; por regex. Abordagem 2: Colocar no init.js $&#40;&#34;a[href^='http://']&#34;&#41;.attr&#40;&#34;target&#34;,&#34;_blank&#34;&#41;; E todo site fica assim; links externos, para fora! Aff&#8230; que doce.]]></description>
			<content:encoded><![CDATA[<p>Pedido: Fazer com que todos os links de uma determinada página sejam externos.</p>
<ul>
<li>Abordagem 1: Alterar a classe em php, genérica, para ver se o link é externo e acrescentar o target; por regex.</li>
<li>Abordagem 2: Colocar no init.js</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a[href^='http://']&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;target&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;_blank&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>E todo site fica assim; links externos, para fora!<br />
Aff&#8230; que doce.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/porque-adoro-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>recursively chmod only subdirectories</title>
		<link>http://www.bitbonsai.com/chmod-dirs-fix/</link>
		<comments>http://www.bitbonsai.com/chmod-dirs-fix/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 14:10:00 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[snippet]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=130</guid>
		<description><![CDATA[When I use Betterzip to uncompress a directory tree, it chmods the dirs with 700. Here&#8217;s the command to solve this: find . -type d &#124; xargs chmod 755 It finds all subdirectories and chmod&#8217;em to 755. Clever, isn&#8217;t it?]]></description>
			<content:encoded><![CDATA[<p>When I use Betterzip to uncompress a directory tree, it chmods the dirs with 700. Here&#8217;s the command to solve this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> d <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span></pre></div></div>

<p>It finds all subdirectories and chmod&#8217;em to 755. Clever, isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/chmod-dirs-fix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deletar .svn recursivamente</title>
		<link>http://www.bitbonsai.com/deletar-svn-recursivamente/</link>
		<comments>http://www.bitbonsai.com/deletar-svn-recursivamente/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 03:39:32 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.bitbonsai.com/?p=128</guid>
		<description><![CDATA[Desde que comecei a usar GIT acho svn clumsy&#8230; prefiro jogar os arquivos no dropbox, que ele guarda versões pra mim. Agora resolvi detonar todos os .svn de um trabalho que estou fazendo. Chega de xalassa&#8230; criar um bash script básico para remover os .svn recursivos salvar no meu ~/bin e dar chmod +x rodar [...]]]></description>
			<content:encoded><![CDATA[<p>Desde que comecei a usar <a href="http://git-scm.com/" target="_blank">GIT</a> acho svn clumsy&#8230; prefiro jogar os arquivos no <a href="http://dropbox.com" target="_blank">dropbox</a>, que ele guarda versões pra mim.</p>
<p>Agora resolvi detonar todos os .svn de um trabalho que estou fazendo. Chega de xalassa&#8230;</p>
<ol>
<li>criar um bash script básico para remover os .svn recursivos</li>
<li>salvar no meu ~/bin e dar chmod +x</li>
<li>rodar e ser feliz.</li>
</ol>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 48px; width: 1px; height: 1px;">#!/bin/sh</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 48px; width: 1px; height: 1px;">echo &#8220;recursively removing .svn folders from&#8221;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 48px; width: 1px; height: 1px;">pwd</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 48px; width: 1px; height: 1px;">rm -rf `find . -type d -name .svn`</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;recursively removing .svn folders from&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">pwd</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> d <span style="color: #660033;">-name</span> .svn<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bitbonsai.com/deletar-svn-recursivamente/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

