<?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>Joe Curlee</title>
	<atom:link href="http://www.joecurlee.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joecurlee.com</link>
	<description></description>
	<lastBuildDate>Sun, 25 Mar 2012 16:21:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Loading Django CMS fixtures in Postgresql</title>
		<link>http://www.joecurlee.com/2012/03/25/loading-django-cms-fixtures-in-postgresql/</link>
		<comments>http://www.joecurlee.com/2012/03/25/loading-django-cms-fixtures-in-postgresql/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 16:21:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.joecurlee.com/?p=216</guid>
		<description><![CDATA[While working on a Django project for a client I ran into an issue regarding fixtures. My development environment is running on sqlite, whereas the production environment is using postgresql on Heroku. In development I created a number of pages using Django CMS. In order to load those pages into production I decided to use [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a Django project for a client I ran into an issue regarding fixtures.</p>
<p>My development environment is running on sqlite, whereas the production environment is using postgresql on Heroku.</p>
<p>In development I created a number of pages using Django CMS. In order to load those pages into production I decided to use fixtures.</p>
<p>I did this by using dumpdata:</p>
<pre><code>
python manage.py dumpdata cms &gt; fixtures/initial_data.cms.json
</pre>
<p></code></p>
<p>I then attempted to load this data on Heroku:</p>
<pre><code>
heroku run python manage.py Project-Name/manage.py loaddata fixtures/initial_data.cms.json
</pre>
<p></code></p>
<p>This failed with the error:</p>
<pre><code>
IntegrityError: duplicate key value violates unique constraint "cms_placeholder_pkey"
</pre>
<p></code></p>
<p>In order to work around this I had to split my fixture into two files by dumping the CMS twice:</p>
<pre><code>
python manage.py dumpdata cms.placeholder &gt;fixtures/initial_data.cms.01.json

python manage.py dumpdata cms googlemap picture text --exclude=cms.placeholder&gt;fixtures/initial_data.cms.02.json
</pre>
<p></code><br />
(note in the second dumpdata I dumped CMS and the installed CMS plugins)</p>
<p>I then loaded these fixtures in order on Heroku:</p>
<pre><code>
heroku run python Project-Name/manage.py loaddata Project-Name/fixtures/initial_data.cms.01.json
heroku run python Project-Name/manage.py loaddata Project-Name/fixtures/initial_data.cms.02.json
</pre>
<p></code></p>
<p>The key here is that you need to load CMS placeholder data first, followed by the rest of the CMS data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joecurlee.com/2012/03/25/loading-django-cms-fixtures-in-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c2e2</title>
		<link>http://www.joecurlee.com/2010/05/07/c2e2/</link>
		<comments>http://www.joecurlee.com/2010/05/07/c2e2/#comments</comments>
		<pubDate>Fri, 07 May 2010 18:34:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://joecurlee.com/?p=131</guid>
		<description><![CDATA[I spent a lot of time in the Threadless Fridge costume during the first c2e2. It was exhausting but thankfully I was able to work in shifts with two other people. Craig made a nice video of it all. Running wild at C2E2 with the Refrigerator! from Threadless.com on Vimeo.]]></description>
			<content:encoded><![CDATA[<p>I spent a lot of time in the Threadless Fridge costume during the first c2e2. It was exhausting but thankfully I was able to work in shifts with two other people.</p>
<p><a href="http://craigshimala.com">Craig</a> made a nice video of it all.</p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=11503788&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=11503788&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a href="http://vimeo.com/11503788">Running wild at C2E2 with the Refrigerator!</a> from <a href="http://vimeo.com/threadless">Threadless.com</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joecurlee.com/2010/05/07/c2e2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AddThis &amp; Flash Cookies: explained &amp; how to disable</title>
		<link>http://www.joecurlee.com/2010/01/30/addthis-flash-cookies-explained-how-to-disable/</link>
		<comments>http://www.joecurlee.com/2010/01/30/addthis-flash-cookies-explained-how-to-disable/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 18:50:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://joecurlee.com/?p=107</guid>
		<description><![CDATA[I recently wrote a tutorial on how to make AddThis work with AJAX. Shortly thereafter I discovered that AddThis uses Flash Cookies ( see AddThis Privacy Policy under the header Cookies ). Flash Cookies explained Flash Cookies as they are commonly known ( technically called Local Shared Objects or LSO for short ) aren&#8217;t really [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote a tutorial on how to <a href="http://joecurlee.com/2010/01/21/how-to-use-addthis-with-ajax-and-overflowauto/">make AddThis work with AJAX</a>.</p>
<p>Shortly thereafter I discovered that AddThis uses Flash Cookies ( see <a href="http://www.addthis.com/privacy">AddThis Privacy Policy</a> under the header Cookies ).</p>
<h3>Flash Cookies explained</h3>
<p>Flash Cookies as they are commonly known ( technically called <a href="http://en.wikipedia.org/wiki/Local_Shared_Object">Local Shared Objects</a> or LSO for short ) aren&#8217;t really cookies, although they function similarly. </p>
<h4>Why LSOs are good</h4>
<ul>
<li>Unlike cookies they are browser independent</li>
<li>Like cookies they are not cross site enabled</li>
</ul>
<h4>Whey LSOs are terrible</h4>
<ul>
<li>Most browsers ( possibly all ) do not delete LSO files when you clear your cookies</li>
<li>LSOs take up more space ( up to 100k by default but unlimited if the user complies ) than a regular cookie ( up to 4k )</li>
<li>LSOs have no expiration date</li>
<li>When you disable cookies in your browser, you haven&#8217;t disabled LSO files</li>
<li>Some websites use LSO files to respawn cookies that you have deleted. this is extremely shady.</li>
<li>In order to globally disable LSO files you have to use the <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html">Global Storage Settings</a> panel on Adobe&#8217;s website</li>
</ul>
<p>AddThis uses <a href="http://en.wikipedia.org/wiki/Clearspring">Clearspring</a> LSO files to track user stats. By the way, Clearspring acquired AddThis in September of 2008. And in case you weren&#8217;t aware: in addition to offering a &#8220;viral distribution product&#8221; Clearspring is also an Ad network.</p>
<h3>Solutions on preventing flash cookies in AddThis</h3>
<p>After learning the information about AddThis and Clearspring I realized that I faced three choices.</p>
<ol>
<li>Keep using AddThis and ignore the fact that it was using LSOs to track people who had visited my sites</li>
<li>Pass settings to AddThis to prevent it from using LSO files</li>
<li>Remove AddThis from all of my sites</li>
</ol>
<p>If you choose to keep AddThis but want to prevent Flash Cookies, use this within the head tags of any page displaying the AddThis button:</p>
<pre><code>addthis_config = {
        data_use_cookies:false,
        data_use_flash:false
    }</code></pre>
<p>I opted for choice #3 and removed AddThis from all of my sites. Even though #2 is possible, I was afraid that AddThis could change the way they handle settings and LSOs would make their way to the computers of anyone visiting my sites.</p>
<p>I am now using <a href="http://sharethis.com/">ShareThis</a> instead and I suggest you do the same.</p>
<h3>Where to go from here</h3>
<p>I highly recommend installing the <a href="https://addons.mozilla.org/en-US/firefox/addon/6623">BetterPrivacy</a> FireFox extension. This extension will allow you to view and delete LSO files that have been stored on your computer. You can set it up to auto delete all LSO files on start or exit of FireFox. You can also set it up to alert you when new LSO files are being stored.</p>
<p>If you are not a <a href="http://www.mozilla.com/en-US/firefox/">FireFox</a> user I recommend you become one.</p>
<p>Your only other solution ( short of monitoring the directories which contain LSOs on a regular basis manually ) is to disable LSO files by using the <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html">Global Storage Settings</a> on Adobe&#8217;s site ( as mentioned above ).</p>
<p>One important thing to note: certain sites use LSOs in a less malicious way than other sites. Some banks use them to identify your computer. Sites like YouTube use them to store your Flash player settings.</p>
<p>This whole issue boils down to your right to privacy. Your right to know what is going on behind the scenes with your computer and to choose what is stored on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joecurlee.com/2010/01/30/addthis-flash-cookies-explained-how-to-disable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use AddThis with AJAX and overflow:auto</title>
		<link>http://www.joecurlee.com/2010/01/21/how-to-use-addthis-with-ajax-and-overflowauto/</link>
		<comments>http://www.joecurlee.com/2010/01/21/how-to-use-addthis-with-ajax-and-overflowauto/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 06:04:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://joecurlee.com/?p=46</guid>
		<description><![CDATA[Notice: before continuing on with this tutorial I urge you to read my newer post concerning AddThis and it&#8217;s use of LSO files. I have been putting together a site recently. It loads with AJAX. As usual I decided to use jQuery for all my AJAX needs. Skip to the tldr if you want the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Notice:</strong> before continuing on with this tutorial I urge you to read my newer post concerning <a href="http://joecurlee.com/2010/01/30/addthis-flash-cookies-explained-how-to-disable/">AddThis and it&#8217;s use of LSO files</a>.</p>
<p>I have been putting together a site recently. It loads with AJAX. As usual I decided to use jQuery for all my AJAX needs. <a href="#tldr" id="top">Skip to the tldr</a> if you want the summary first.</p>
<p>This site calls for a sharing functionality, and I like <a href="http://www.addthis.com">AddThis</a> for it&#8217;s simplicity and documentation. However as soon as I implemented AddThis I ran in to two separate issues.</p>
<h3>Issue #1: AddThis and overflow:auto Containers</h3>
<p>This site has a scrolling div for it&#8217;s main content area which is where the AddThis buttons live, and this is where I ran in to my first issue. It turns out that when an AddThis button is contained within a scrolling div it is unable to readjust the hover window when a user starts to scroll. It creates for a pretty horrible UI experience.<br />
The easiest way to get around this is to go with the expanded menu. This requires the user to click on the button. A window is then displayed in the middle of the screen, similar to Thickbox ( or colorbox ).</p>
<p><strong>To use the expanded menu, simply use the classname &#8220;addthis_button_expanded&#8221; rather than &#8220;addthis_button&#8221; on your AddThis link.</strong></p>
<h3>Issue #2: Addthis and AJAX pages</h3>
<p>The second issue I ran in to was not as simple to solve and that is the problem of loading AddThis for content generated through AJAX calls. </p>
<p>First off you need to append a variable to the AddThis script. The URL will look like this:</p>
<pre><code>http://s7.addthis.com/js/250/addthis_widget.js#domready=1</code></pre>
<p>This solution is offered up by AddThis staff in the forums and actually seems to fix everything perfectly. However, if you need to reload the page dynamically ( in my case with AJAX ) the AddThis buttons will no longer work. This is because the DOM is re-rendered, but the AddThis script isn&#8217;t re-initialized.</p>
<p>There is absolutely no solution offered up by the AddThis staff for this problem. They acknowledge this issue but state that there is no re-initialization function in AddThis. I spent several hours attempting to find a solution to this through the forums and Google. In the end I came up with my own solution by analyzing the AddThis script.</p>
<p>The fix is very easy. Simply place the following code in a callback function that is loaded after your AJAX call successfully completes:</p>
<pre><code>
var script = 'http://s7.addthis.com/js/250/addthis_widget.js#domready=1';
if (window.addthis){
    window.addthis = null;
}
$.getScript( script );</code></pre>
<p>That&#8217;s it. You should now be able to re-initialize the AddThis script after AJAX calls.</p>
<h3>Step by Step Tutorial</h3>
<p>First off you need to place the following code in your HTML page</p>
<pre><code>&lt;a class=&quot;addthis_button_expanded&quot;
   addthis:url=&quot;&lt;URL_HERE&gt;&quot;
   addthis:title=&quot;&lt;TITLE HERE&gt;&quot;
   href=&quot;http://www.addthis.com/bookmark.php?v=250&quot;&gt;
&lt;img src=&quot;&lt;SHARE ICON URL HERE&gt;&quot; alt=&quot;share icon&quot; title=&quot;AddThis&quot; /&gt;
SHARE
&lt;/a&gt;</code></pre>
<p>Feel free to tweek the title and alt tags of course. Leave the a tag&#8217;s classname set to &#8220;addthis_button_expanded&#8221;. This tells addthis to use the popup box rather than the hover box. If you want to use the hoverbox, change the classname to &#8220;addthis_button&#8221; instead.<br />
Further information can be found on the <a href="http://www.addthis.com/help/">AddThis help page</a>.</p>
<p>Next comes the Javascript. I use jQuery and this example will be illustrated as such. Change the code according to the library of your choice.</p>
<pre><code>
function Loader() {}

Loader.prototype.load = function( url )
{
	var self = this;
	$.ajax( {
		type: &#x27;POST&#x27;,
		data: { ajax: true },
		dataType: &#x27;html&#x27;,
		url: url,
		success: function( content ) {
			$.fn.colorbox( {
				html: &#x27;&lt;div class=&quot;ajax&quot;&gt;&#x27;+ content +&#x27;&lt;/div&gt;&#x27;,
				transition: &#x27;none&#x27;
			} );

			$().unbind(&quot;keydown.cbox_close&quot;); // Disable close on esc key press

			self.addthis_init()
		}
	} );
}

Loader.prototype.addthis_init = function()
{
    var script = &#x27;http://s7.addthis.com/js/250/addthis_widget.js#domready=1&#x27;;
    if ( window.addthis ) {
        window.addthis = null;
    }
    $.getScript( script );
}

var loader = new Loader;
$( document ).ready( function() {
	loader.init();
} );
</code></pre>
<p>Of course you can tweak this Javascript to fit your site. The most important thing to note is the <strong>addthis_init</strong> call. Setting window.addthis to null unloads the script and forces it to reload. Without this subsequent AJAX loads of your page will fail unless you refresh the browser first&#8230; which clearly defeats the whole purpose for using AJAX.</p>
<p><strong>Note:</strong><br />
These fixes were tested on Google Chrome 4.0.249.49, Firefox 3.5.7 and Safari 4.0.2 I will be confirming the fix for Windows browsers soon.</p>
<h3>tldr</h3>
<p><a href="#top" id="tldr">back to top</a></p>
<p>AddThis breaks when placed inside of overflow:auto containers and when loading pages with AJAX. Use the expanded menu button to fix the overflow issue. Remove addthis from the window by setting it to null before dynamically reloading the AddThis script with a Javascript call.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joecurlee.com/2010/01/21/how-to-use-addthis-with-ajax-and-overflowauto/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>

