<?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
<channel>
	<title>sbramley - coding life</title>
	<link>http://sbramley.com</link>
	<description>A random view of all things in the world wide web</description>
	<lastBuildDate>Wed, 21 Dec 2011 18:19:34 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	<!-- generator="WordPress/3.2.1" -->

	<item>
		<title>How to use Split with jQuery?</title>
		<description><![CDATA[var str = 'something -- something_else'; var substr = str.split(' -- '); // substr[0] contains &#34;something&#34; // substr[1] contains &#34;something_else&#038;quot]]></description>
		<link>http://sbramley.com/2011/12/how-to-use-split-with-jquery/</link>
			</item>
	<item>
		<title>MongoDB + power outage = downtime</title>
		<description><![CDATA[MongoDB handles unexpected shutdowns quite appallingly, one thing that I always forget is the general server language for speaking with the server and getting the info I need to get her back up and running. $ sudo status mongodb $ sudo stop mongodb $ sudo start mongodb $ sudo restart mongodb To see whats going on&#8230; If you see &#8220;Error: couldn’t connect to server 127.0.0.1} (anon):1137&#8243; This condition is largely ]]></description>
		<link>http://sbramley.com/2011/12/mongodb-power-outage-downtime/</link>
			</item>
	<item>
		<title>Apache Address already in use: make_sock: could not bind to port 80 error and solution</title>
		<description><![CDATA[Just had this delightful problem tonight, fix: First make sure port 80/443 is not used by any other service or application with netstat command: # netstat -tulpn&#124; grep :80 If port 80 is bind to httpd, kill all process: # killall -9 httpd Now start the httpd: # /etc/init.d/httpd start Make sure it&#8217;s a user capable of sudo]]></description>
		<link>http://sbramley.com/2011/12/apache-address-already-in-use-make_sock-could-not-bind-to-port-80-error-and-solution/</link>
			</item>
	<item>
		<title>Creating a soft or symbolic link in ubuntu</title>
		<description><![CDATA[Sometimes you want to link to a directory that isn&#8217;t necessarily within the web root for the particular site you are on. Simple enough solution for it though. ln -s /webroot/home/httpd/test.com/index.php /home/sbramley/index.php or ln -s /webroot/home/httpd/test /home/sbramley/ So you can link to a directory of file easyyyyy]]></description>
		<link>http://sbramley.com/2011/12/creating-a-soft-or-symbolic-link-in-ubuntu/</link>
			</item>
	<item>
		<title>Twisted Knickers &#8211; Change is good</title>
		<description><![CDATA[Twisted knickers is a site I built when I first started building sites, unfortunately web standards were pretty shocking back then and my skill set wasn&#8217;t up to par. The entire site was built using a table (yes, before I knew how to float divs). So when I got the opportunity to fix it up this year I jumped at the opportunity, who likes having their name against something that ]]></description>
		<link>http://sbramley.com/2011/12/twisted-knickers-change-is-good/</link>
			</item>
	<item>
		<title>Matching a string</title>
		<description><![CDATA[I just posted on splitting a string, might as well add my match as they can often come hand in hand. preg_match(&#34;your search item&#34;, &#34;your_string&#34;) Boom, done]]></description>
		<link>http://sbramley.com/2011/12/matching-a-string/</link>
			</item>
	<item>
		<title>Splitting a string</title>
		<description><![CDATA[I&#8217;ve just spent 15 minutes looking for this darn function, never again! Here is how to split a string to get the information you require: Edit: A wise PHP guru just gave me an alternative option as well. $chars = explode('-', &#34;your-string-here&#34;); Is the same as: $chars = preg_split('/-/', &#34;your-string-here&#34;, -1, PREG_SPLIT_NO_EMPTY); $your = $chars[0]; $string = $chars[1]; $here = $chars[2]; Works just peachy]]></description>
		<link>http://sbramley.com/2011/12/splitting-a-string/</link>
			</item>
	<item>
		<title>Update table with join function &#8211; MYSQL</title>
		<description><![CDATA[True story, I always forget where each value should be positioned for a left join on an update statement. This is always useful for a reference guide for me: UPDATE t1 LEFT JOIN t2 ON t2.id = t1.id SET t1.col1 = newvalue WHERE t2.id IS ]]></description>
		<link>http://sbramley.com/2011/12/update-table-with-join-function-mysql/</link>
			</item>
	<item>
		<title>PHP shorthand IF statements</title>
		<description><![CDATA[Easy to forget the correct syntax but darn it&#8217;s useful, a recap on shorthand php if statements. Basic True / False Declaration $is_admin = ($user['permissions'] == 'admin' ? true : false); Conditional Welcome Message echo 'Welcome '.($user['is_logged_in'] ? $user['first_name'] : 'Guest').'!'; Conditional Items Message echo 'Your cart contains '.$num_items.' item'.($num_items != 1 ? 's' : '').'.'; Conditional Error Reporting Level error_reporting($WEBSITE_IS_LIVE ? 0 : E_STRICT); Conditional Basepath echo '&#60;base href=&#34;http'.($PAGE_IS_SECURE ]]></description>
		<link>http://sbramley.com/2011/12/php-shorthand-if-statements/</link>
			</item>
	<item>
		<title>Clickable elements</title>
		<description><![CDATA[&#60;a&#62; tags are great for text and images, but what about divs? or list elements? not so much. With most of my images, I set them as background images of a div, when it comes to positioning divs on a page it&#8217;s just easier than having to mess with the images within them as well. Here&#8217;s a tidy way of making your div clickable. &#60;div onclick=&#34;location.href='http://sbramley.com/';&#34; style=&#34;cursor: pointer;&#34;&#62; &#60;/div&#038;gt]]></description>
		<link>http://sbramley.com/2011/12/clickable-elements/</link>
			</item>
</channel>
</rss>

