<?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>bradKELLETT &#187; hack</title>
	<atom:link href="http://bradkellett.com/p/tag/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://bradkellett.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 04:45:47 +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>Documenting the Hacks: CSS Browser Targeting</title>
		<link>http://bradkellett.com/p/documenting-the-hacks-css-browser-targeting/</link>
		<comments>http://bradkellett.com/p/documenting-the-hacks-css-browser-targeting/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 03:30:11 +0000</pubDate>
		<dc:creator>Brad Kellett</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css hacks]]></category>
		<category><![CDATA[css property]]></category>
		<category><![CDATA[css selector]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[internet explorer 7]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[target]]></category>
		<category><![CDATA[targeting]]></category>

		<guid isPermaLink="false">http://pantsland.com/?p=318</guid>
		<description><![CDATA[I think I&#8217;m somewhat of a rarity in the world of web developers &#8211; I actively use and certainly approve of CSS hacks to target and fix certain browsers. Of course, I don&#8217;t condone their use unless it is absolutely necessary, and in most cases good, standards compliant CSS should alleviate most issues before they [...]]]></description>
			<content:encoded><![CDATA[<p>I think I&#8217;m somewhat of a rarity in the world of web developers &#8211; I actively use and certainly approve of CSS hacks to target and fix certain browsers. Of course, I don&#8217;t condone their use unless it is absolutely necessary, and in most cases good, standards compliant CSS should alleviate most issues before they occur, but when there is a need I think these hacks can be a great way to fix issues while still keeping your CSS logical and concise. The caveat to this is that all hacks need good comments to describe what is going on for future reference, whether that be your own or that of another developer. Also, always keep in mind that hacks can break when new browser versions are released, so always keep an eye out and use them sparingly.</p>
<p>I&#8217;ve always found it hard to find a good reference for these hacks. There are many sites that talk about an individual hack, but finding a single place that goes through targeting all the different browsers has been hard. This post hopes to solve that &#8211; more for my own use, but hopefully other developers can find it useful as well. What follows are the hacks that I use, which I believe to be the most logical and simple ones out there. In every case, <em>#selector</em> represents the element you want to apply a rule to (this can be either an ID or a class), and <em>property</em> and <em>value</em> represent any normal CSS property.</p>
<p><span id="more-318"></span></p>
<h3>Internet Explorer 6</h3>
<p>Let&#8217;s start with the one that developers will probably need to use most often. To target IE6:</p>
<div class="codesnip-container" >
<div class="css codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="re0">#selector</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; _property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<h3>Internet Explorer 7</h3>
<p>The following targets IE7 and below. You can use it in conjunction with the above rule to be able to target IE7 and IE6 individually &#8211; just make sure you declare the IE7 rule first, then the IE6 rule.</p>
<div class="codesnip-container" >
<div class="css codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Target IE7 and below */</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#selector</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="sy0">*</span>property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Then overwrite for targeting IE6 specifically */</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#selector</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; _property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<h3>Firefox 2</h3>
<p>The easiest way to target versions of Firefox is with selectors that only work in Gecko-based browsers. The following will target Firefox version 2 and below:</p>
<div class="codesnip-container" >
<div class="css codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="re0">#selector</span><span class="sy0">,</span> x<span class="re2">:-moz-any-link </span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<h3>Firefox 3</h3>
<p>As with the Internet Explorer 7 hack, you can easily combine the Firefox 2 and Firefox 3 hacks to target those specific versions of Firefox.</p>
<div class="codesnip-container" >
<div class="css codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Target Firefox 2 */</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#selector</span><span class="sy0">,</span> x<span class="re2">:-moz-any-link </span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Then overwrite for Firefox 3 specifically */</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#selector</span><span class="sy0">,</span> x<span class="re2">:-moz-any-link</span><span class="sy0">,</span> x<span class="sy0">:</span><span class="kw2">default</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<h3>Safari 3.0+</h3>
<p>The following will target Safari version 3 and above. To target just Safari 3.1, see the next hack. <strong>Note</strong> that this is valid CSS3, and as such other browsers will eventually start supporting it, so be wary.</p>
<p><strong><em>Update:</em></strong><em> Firefox 3.5 now supports this, and will read the style</em></p>
<div class="codesnip-container" >
<div class="css codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1">body<span class="re2">:first-of-type </span><span class="re0">#selector</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; property<span class="sy0">:</span>value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<h3>Safari 3.1 and Google Chrome</h3>
<p>Google Chrome and Safari both use the Webkit rendering engine, and as such shouldn&#8217;t usually need to be targeted separately. So far, I have not found a way to target just Google Chrome, so attack that with JavaScript for the best results. Make sure you declare this <em>after</em> the Safari 3.0 hack above, as Chrome and Safari 3.1 will read that as well.</p>
<p><strong><em>Update:</em></strong><em> Firefox 3.5 now supports this, and will read the style</em></p>
<div class="codesnip-container" >
<div class="css codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1">body<span class="re2">:nth-of-</span>type<span class="br0">&#40;</span>1<span class="br0">&#41;</span> <span class="re0">#selector</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<h3>Opera 9</h3>
<p>While Opera is pretty good at rendering standards compliant code, and won&#8217;t generally need hacks, there are times when it is necessary. Unfortunately, I haven&#8217;t found a good way to target just Opera &#8211; instead, the easiest way is to use a rule that targets Opera and Safari (and other Webkit browsers like Chrome), then reset for the Webkit browsers.</p>
<div class="codesnip-container" >
<div class="css codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Declare for Opera and Webkit */</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">@media screen and (-webkit-min-device-pixel-ratio:0){</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re0">#selector</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; property<span class="sy0">:</span> value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Revert for Safari (and other Webkit browsers) and Firefox 3.5 */</span></div>
</li>
<li class="li1">
<div class="de1">body<span class="re2">:first-of-type </span><span class="re0">#selector</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; property<span class="sy0">:</span>value<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://bradkellett.com/p/documenting-the-hacks-css-browser-targeting/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Simple iPhone 1.1.2 Upgrade Instructions (with Unlock)</title>
		<link>http://bradkellett.com/p/simple-iphone-112-upgrade-instructions-with-unlock/</link>
		<comments>http://bradkellett.com/p/simple-iphone-112-upgrade-instructions-with-unlock/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 01:14:40 +0000</pubDate>
		<dc:creator>Brad Kellett</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[1.1.1]]></category>
		<category><![CDATA[1.1.2]]></category>
		<category><![CDATA[brick]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[jailbreak]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.pantsland.com/2007/12/03/simple-iphone-112-upgrade-instructions-with-unlock/</guid>
		<description><![CDATA[Comments for this post are now closed and the guide is made available for reference only. I have published my guide to jailbreaking and unlocking firmware 1.1.3, please refer to that to upgrade to the newer firmware version. I have been messing around for a day or so trying to get this to work, but [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Comments for this post are now closed and the guide is made available for reference only. I have published my <a href="http://www.pantsland.com/2008/02/09/simple-iphone-113-upgrade-instructions-with-unlock/">guide to jailbreaking and unlocking firmware 1.1.3</a>, please refer to that to upgrade to the newer firmware version.</strong></p>
<p>I have been messing around for a day or so trying to get this to work, but I think I&#8217;ve nailed the method for upgrading an unlocked and jailbroken iPhone to firmware 1.1.2, and preserving the unlock and jailbreak.  What follows are the steps to get your iPhone to 1.1.2 written as simply as I could manage. These instructions look long (and they are), but they are easy to follow and anyone with basic computer skills should be able to get it done. Remember: there is no predicament that you can get your phone into that can&#8217;t be repaired.</p>
<p><span id="more-251"></span></p>
<p><strong>Note: I do not warrant these instructions. While I have taken the utmost care in writing them, and have performed the steps on my own iPhone successfully, you can break things and I am not responsible if you brick your phone (though I will try and help if you do).</strong></p>
<p>Now that we have that out of the way, here are the steps. This assumes you are currently using firmware 1.1.1; if you need a guide for getting to 1.1.1, leave a comment and if there is demand for it I will make one. You also need access to a WiFi network with internet access. If you don&#8217;t wish to unlock your phone, instead just performing a jailbroken upgrade, skip to step 4.8. It is possible to run the unlock application from within firmware 1.1.2, but I do not recommend it &#8211; there have been reported problems doing so, and doing it this way is the safe bet.<br />
<!--adsense--></p>
<ol start="0">
<li>Prerequisites<br />
<blockquote>
<ul>
<li>Conceited Software&#8217;s 1.1.2 jailbreak tools (<a href="http://conceitedsoftware.com/iphone/site/112jb.html">here</a>)</li>
<li>the iphone-elite team&#8217;s custom anySIM 1.2u (<a href="http://code.google.com/p/iphone-elite/downloads/detail?name=anySIM1.2.1u.zip&amp;can=2&amp;q=">here</a>)</li>
<li>Apple&#8217;s iPhone firmware 1.1.1 package (<a href="http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-3883.20070927.In76t/iPhone1,1_1.1.1_3A109a_Restore.ipsw">here</a>)</li>
<li>Apple&#8217;s iPhone firmware 1.1.2 package (<a href="http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-4037.20071107.5Bghn/iPhone1,1_1.1.2_3B48b_Restore.ipsw">here</a>)</li>
<li>AppTap Installer for Windows users (<a href="http://www.nullriver.com/~adam/AppTappInstaller.exe">here</a>), or iNdependence 1.3.2 beta for Mac users (<a href="http://independence.googlecode.com/files/iNdependence_v1.3.2_beta.dmg">here</a>)</li>
</ul>
</blockquote>
</li>
<li>Upgrade to 1.1.2 through iTunes<br />
<blockquote><p>Surprisingly, step one is to actually perform an upgrade. This may sound counter-intuitive, but to unlock the device, you need to be running the latest version of the baseband firmware (the part that controls the phone functions of the device). If you are running firmware 1.1.1, you are ready to do the upgrade.</p>
<ol>
<li>Connect your iPhone to iTunes, let it recognize it as unactivated.</li>
<li>With the phone still plugged in, hold the power and home buttons until the screen goes black, then let go of just the power button while still holding the home button. Within about 10 seconds, iTunes should say it has detected an iPhone in restore mode, but the device&#8217;s screen should still be black. If the iPhone&#8217;s screen isn&#8217;t still black, try again.</li>
<li>Hold the shift key if you are running Windows, or the option key on a Mac, and click the restore button in iTunes.</li>
<li>Browse to where you saved the 1.1.2 firmware file from the prerequisites section. It should end with .ipsw, if it doesn&#8217;t, rename it first.</li>
<li>Your iPhone should sucessfully flash to firmware 1.1.2 and restart.</li>
</ol>
</blockquote>
</li>
<li>Downgrade to firmware 1.1.1<br />
<blockquote><p>This is a crucial step if you are unlocking your device. The iphone-elite team&#8217;s unlock application works great on the latest baseband version, but only runs from firmware 1.1.1. Here&#8217;s how to roll back to firmware 1.1.1, but continue running the new baseband:</p>
<ol>
<li>Connect your recently updated phone to iTunes, let it recognize it as unactivated.</li>
<li>With the phone still plugged in, hold the power and home buttons until the screen goes black, then let go of just the power button while still holding the home button. Within about 10 seconds, iTunes should say it has detected an iPhone in restore mode, but the device&#8217;s screen should still be black. If the iPhone&#8217;s screen isn&#8217;t still black, try again.</li>
<li>Hold the shift key if you are running Windows, or the option key on a Mac, and click the restore button in iTunes.</li>
<li>Browse to where you saved the 1.1.1 firmware file from the prerequisites section. It should end with .ipsw, if it doesn&#8217;t, rename it first.</li>
<li>iTunes will flash your phone, but will fail with error 1015, this is expected.</li>
<li>Close iTunes. If you are using a Mac, extract and run iNdependence, which should bring your phone back to the activation screen after a minute or so. Windows users, run AppTap Installer. It will fail, but should still bring your iPhone to the activation screen.</li>
</ol>
</blockquote>
</li>
<li>Activate firmware 1.1.1, install Installer.app<br />
<blockquote><p>With your phone at the activation screen:</p>
<ol>
<li>Slide to get to the emergency call screen</li>
<li>Enter *#307# and press call, your phone will start ringing</li>
<li>Delete the numbers just entered, enter 0 and press call. This will take you to a screen where you can answer the incoming &#8216;call&#8217;</li>
<li>Press answer, then hold, and when the phone starts ringing again, press decline. You will now be in the phone application</li>
<li>Go to Contacts, then add a new contact. Add the URLs <em>prefs://11</em> and <em>http://jailbreakme.com</em> to the contact and save it</li>
<li>Press the <em>prefs://11</em> URL, which should take you to the WiFi configuration screen. Configure for your WiFi access point as normal, then press the Settings button at the top of the screen to go to the settings menu, select General and turn Auto Lock to never. Press the home button</li>
<li>You will now be at the activate screen. Slide to go to the emergency call screen, enter 0 and press call and your phone will start to ring. Press answer, then hold, then when the phone starts ringing again, press decline. You will be back in the phone application</li>
<li>Select the second URL on the contact you created in step 5. This will open Safari with jailbreakme.com open. Scroll to the bottom and press Install AppSnap. Your phone should go back to the activate screen, then restart itself after a few minutes. If it doesn&#8217;t, restart it manually and try again from step 7. Otherwise, once it restarts you should have an activated iPhone with the Installer.app on your home screen</li>
</ol>
</blockquote>
</li>
<li>Unlock and prepare the iPhone for firmware 1.1.1<br />
<blockquote>
<ol>
<li>Run Installer.app and let it download any required updates</li>
<li>Select Install at the bottom of the screen, scroll to System and install the BSD Subsystem, then scroll to the Network category and install OpenSSH. Reboot your phone</li>
<li>Extract the AnySIM zip file from the prerequisites section and rename the resulting folder to anySIM.app</li>
<li>Connect your phone to your WiFi network and note it&#8217;s IP address, which can be seen by pressing the small arrow beside the network name in the settings screen. From your PC, open an FTP program that is compatible with SFTP (<a href="http://winscp.net/eng/download.php">WinSCP</a> on Windows, <a href="http://www.fetchsoftworks.com/downloads.html">Fetch</a> on a Mac).</li>
<li>Enter your iPhone&#8217;s IP address to connect to, then the username <em>root</em> and password <em>alpine</em></li>
<li>Browse to /Applications on your phone and upload the entire anySIM.app folder to your phone. You should now have the folder /Applications/anySIM.app full of files</li>
<li>In your SFTP program, open the folder you just uploaded, and right click (Ctrl click on a Mac) on the first file in the list (it should just be called &#8216;anySIM&#8217;). In Fetch, select <em>Get Info</em>, then in the new window expand the <em>Ownership and Permissions</em> section and check the box next to <em>Execute</em> in the <em>Owner</em> section. In WinSCP, select <em>Properties</em>, and check the box next to <em>X</em> in the <em>Owner</em> section near the bottom of the new window.</li>
<li>Restart your iPhone, then press the new anySIM icon on your home screen. Follow the instructions from anySIM</li>
<li>Once the above is complete, run Installer.app, select the &#8216;Tweaks (1.1.1)&#8217; category, and install OktoPrep</li>
</ol>
</blockquote>
</li>
<li>Upgrade to firmware 1.1.2 and jailbreak<br />
<blockquote>
<ol>
<li>Connect your iPhone to your computer and allow iTunes to detect it</li>
<li>Hold the shift key if you are running Windows, or the option key on a Mac, and click the <strong>update</strong> button in iTunes.</li>
<li>Browse to where you saved the 1.1.2 firmware file from the prerequisites section. It should end with .ipsw, if it doesn&#8217;t, rename it first.</li>
<li>Your phone should upgrade without a problem, then return to the activation screen on firmware 1.1.2. Close iTunes and extract Conceited Software&#8217;s jailbreak tools. From the extracted files, Windows users double click on &#8216;windows.bat,&#8217; Mac users double click &#8216;jailbreak.jar.&#8217;</li>
<li>Check the Install SSH box, then enter a password that will be used if you want to connect to your device later on, then click the big jailbreak button. This will jailbreak your phone, activate it, and fix YouTube so it will work</li>
</ol>
</blockquote>
</li>
</ol>
<p>For those users using SIM cards from a country that currently sells the iPhone, such as the US, UK, and Germany, that&#8217;s it! You now have an activated, jailbroken, and unlocked iPhone ready to go.</p>
<p>Users that are attempting to use a SIM card from another country, you still have a few more steps to go. Flick over to the next page for the meat.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradkellett.com/p/simple-iphone-112-upgrade-instructions-with-unlock/feed/</wfw:commentRss>
		<slash:comments>357</slash:comments>
		</item>
	</channel>
</rss>

