<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cameron Wardzala</title>
    <description>The latest articles on DEV Community by Cameron Wardzala (@cwardzala).</description>
    <link>https://dev.to/cwardzala</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F9197%2F2f8ee6aa-7b75-4a3d-b841-584b32aa3291.PNG</url>
      <title>DEV Community: Cameron Wardzala</title>
      <link>https://dev.to/cwardzala</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cwardzala"/>
    <language>en</language>
    <item>
      <title>Hi, I'm Cam</title>
      <dc:creator>Cameron Wardzala</dc:creator>
      <pubDate>Mon, 24 Jul 2017 17:14:54 +0000</pubDate>
      <link>https://dev.to/cwardzala/hi-im-cameron-wardzala</link>
      <guid>https://dev.to/cwardzala/hi-im-cameron-wardzala</guid>
      <description>&lt;p&gt;I have been coding for 18 years.&lt;/p&gt;

&lt;p&gt;You can find me on GitHub as &lt;a href="https://github.com/cwardzala" rel="noopener noreferrer"&gt;cwardzala&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I live in Cleveland.&lt;/p&gt;

&lt;p&gt;I work for &lt;a href="http://findaway.com" rel="noopener noreferrer"&gt;Findaway&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: HTML, CSS, Javascript, Python.&lt;/p&gt;

&lt;p&gt;I am currently learning more about being a better person.&lt;/p&gt;

&lt;p&gt;Nice to meet you.&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
    <item>
      <title>Solving Mysteries in Magento</title>
      <dc:creator>Cameron Wardzala</dc:creator>
      <pubDate>Wed, 11 May 2016 04:00:00 +0000</pubDate>
      <link>https://dev.to/cwardzala/solving-mysteries-in-magento-3hmg</link>
      <guid>https://dev.to/cwardzala/solving-mysteries-in-magento-3hmg</guid>
      <description>&lt;p&gt;Not long ago our Magento eCommerce website started logging a strange and cryptic exception.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PHP Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Mage_Core_Model_Con
fig_Element' is not allowed' in [no active file]:0\nStack trace:\n#0 {main}\n thrown in [no active file] on line 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With no context about what this means I turned to Google. Little of the results helped trace down what the issue was. Since it never appeared to affect our users I pushed it to the side to solve another day.&lt;/p&gt;

&lt;p&gt;Around the time the exception began, I noticed alert messages were never getting cleared. A message would just stay around until the user logged out and cleared their session.&lt;/p&gt;

&lt;p&gt;After a few months, I found time to dig into the messages issue. I started poking around at our extension of Magento’s built-in messages class. Once I ruled that out as the source of the issue, I moved on to more aggressive measures to find the issue. I turned on every debug option I could find. With DEBUG ALL THE THINGS mode turned on I saw our old cryptic message popping up again. This led me to dig into that once again. Google didn’t provide much in the way of solutions, but it did point me in the direction of our session storage. I began poking around and looking for anywhere we put something into session. Once I ruled out &lt;code&gt;string&lt;/code&gt; and &lt;code&gt;int&lt;/code&gt; types as an issue, I looked at other data types. EUREKA! I found a function trying to store an instance of the &lt;code&gt;Findaway_MultiCart_Model_Quote&lt;/code&gt; Class. Commenting out the code and reloading proved that was the source.&lt;/p&gt;

&lt;p&gt;Moral of the story, test and look for exceptions related to new code. It’s amazing this was so easy to fix given it was so difficult to track down. This could have been quicker had PHP exposed a more useful message, or had Magento raised an exception.&lt;/p&gt;

</description>
      <category>tech</category>
      <category>magento</category>
      <category>ecommerce</category>
      <category>php</category>
    </item>
    <item>
      <title>Image Preloading in CSS</title>
      <dc:creator>Cameron Wardzala</dc:creator>
      <pubDate>Fri, 22 Feb 2013 14:59:00 +0000</pubDate>
      <link>https://dev.to/cwardzala/image-preloading-in-css-49ad</link>
      <guid>https://dev.to/cwardzala/image-preloading-in-css-49ad</guid>
      <description>&lt;p&gt;Something that I hadn’t thought about in a while was image preloading in css. The other day I sent &lt;a href="http://busticated.org"&gt;Matt&lt;/a&gt; a code review because the way he was preloading an image was causing some odd behavior. We talked about it and could not think of a good solution, or better preload option so I removed his preload CSS (below).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url(/path/to/image.jpg)&lt;/span&gt; &lt;span class="nb"&gt;no-repeat&lt;/span&gt; &lt;span class="m"&gt;-1000px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In most cases, I think this method would work but in our case, it was causing pages with short content to have an unstyled block of white on the bottom of the page. I wasn’t sure how to tell him to fix this, we really didn't want to go the old JS route but could not find a way to do this in CSS.&lt;/p&gt;

&lt;p&gt;Then for no reason, I was poking around the source of &lt;a href="http://foundation.kr"&gt;http://foundation.kr&lt;/a&gt; and found this little gem that made total sense to me.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="nd"&gt;:before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url()&lt;/span&gt; &lt;span class="sx"&gt;url()&lt;/span&gt; &lt;span class="p"&gt;...;&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My first thought was “Oh my gosh this is amazing!”. Then I started wondering if the image would download because &lt;code&gt;display:none&lt;/code&gt;. I updated our code to use this method of preloading and IT WORKED! I grabbed Matt and showed him and he asked the same question I did about the display property. Because the image url is the content of the pseudo-element it gets downloaded regardless of the display property. Unlike background images which don’t get downloaded until the image display is something other than none.&lt;/p&gt;

&lt;p&gt;And the best part about this method is you can have as many &lt;code&gt;url()&lt;/code&gt; in the content and they will all get downloaded!&lt;/p&gt;

</description>
      <category>tech</category>
      <category>frontend</category>
    </item>
    <item>
      <title>How We Grew Out of Bootstrap</title>
      <dc:creator>Cameron Wardzala</dc:creator>
      <pubDate>Thu, 14 Feb 2013 14:06:00 +0000</pubDate>
      <link>https://dev.to/cwardzala/how-we-grew-out-of-bootstrap-4b3n</link>
      <guid>https://dev.to/cwardzala/how-we-grew-out-of-bootstrap-4b3n</guid>
      <description>&lt;p&gt;When we started our redesign of the Cheezburger network we had the daunting task of building a front-end framework that met the needs of not only our developers but our vast network of sites. After many meetings, grueling discussions and attempts at DIY we finally choose [twitter] &lt;a href="http://getbootstrap.com"&gt;Bootstrap&lt;/a&gt;. It was the ‘it’ framework and had just reached its 2.0 milestone, so why not?&lt;/p&gt;

&lt;p&gt;Going into this we had no idea how to take bootstrap and make it Cheezburger. We initially tried to “extend” Bootstrap by overriding styles in our own chzboot library. This proved to be less than ideal since we were duplicating code for everything we wanted to extend. Eventually, we merged our changes with Bootstrap core and forfeited any upgrade path to newer versions.&lt;/p&gt;

&lt;p&gt;Our own pseudo fork of Bootstrap has worked well throughout. However, as our design has changed and matured we have begun to migrate away from the Bootstrap core components and build our own. It was nice to have Bootstrap to fall back on when we needed a quick UI treatment for something, but now we have our own style guide and documentation around what components to use and how to use them. If something isn’t in the style guide then we need to build and add it to the bucket of things that can be reused later.&lt;/p&gt;

&lt;p&gt;It has become difficult to develop our own components along with maintaining existing Bootstrap based components. Finding parity between what Bootstrap offers and the needs of our sites is the one thing that has effectively driven us away from continuing to use Bootstrap as our core foundation. We have talked about completely removing anything Bootstrap from our code and rewriting components, but that is a task that isn’t logical at this time. Eventually, as we continue to mature our code Bootstrap will play less of a role.&lt;/p&gt;

&lt;p&gt;Ultimately we grew out of bootstrap not because it’s a bad framework but because we grew up, we started needing things that were not in its core. We changed so much it didn’t make sense to continue to maintain a connection to the core library. We have maintained many of the naming and structural conventions that bootstrap employs but we don’t rely on its library of UI elements.&lt;/p&gt;

&lt;p&gt;One thing I didn’t mention, when we made the decision to use Bootstrap over creating our own I pushed for it out of fear of “re-inventing the wheel”†. Throughout this experience I have come to believe you should not fear re-inventing the wheel, you should fear using a round wheel when you need a square one.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;† I don’t want to speak for &lt;a href="http://twitter.com/b_sted"&gt;@b_sted&lt;/a&gt;, &lt;a href="http://twitter.com/marthakelly"&gt;@marthakelly&lt;/a&gt;, or &lt;a href="http://twitter.com/trademark"&gt;@trademark&lt;/a&gt; but this was my biggest fear going into the redesign.&lt;/small&gt;&lt;/p&gt;

</description>
      <category>cheezburger</category>
      <category>tech</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Using SignalR with RequireJS</title>
      <dc:creator>Cameron Wardzala</dc:creator>
      <pubDate>Fri, 09 Nov 2012 15:16:00 +0000</pubDate>
      <link>https://dev.to/cwardzala/using-signalr-with-requirejs-29a6</link>
      <guid>https://dev.to/cwardzala/using-signalr-with-requirejs-29a6</guid>
      <description>&lt;p&gt;If you don’t know about SignalR and RequireJS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/SignalR/SignalR"&gt;https://github.com/SignalR/SignalR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://requirejs.org"&gt;http://requirejs.org&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I was building my app with SignalR and RequireJS there were two steps I needed before stuff would work.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Setup dependencies
&lt;/h2&gt;

&lt;p&gt;I needed to wrap all my SignalR javascript so they will work properly with RequireJS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;jquery&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jquery-1.8.2.min&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;shim&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jquery.signalR-0.5.3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jquery&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/signalr2/hubs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jquery&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jquery.signalR-0.5.3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the great shim feature of RequireJS 2. I can use non-AMD compatible scripts with RequireJS without manually wrapping them in define() statements. I also set the path for jquery because it is a named module and is required by the SignalR scripts.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Fix SignalR $.connection.hub.start()
&lt;/h2&gt;

&lt;p&gt;I am calling SignalR’s $.connection.hub.start() from within a $(document).ready(). Even before I started using RequireJS to load my scripts this worked fine. However, after moving to RequireJS this stopped working. Why? basically, SignalR will by default delay starting your connection until the page has completely loaded. Enter the &lt;code&gt;waitForPageLoad&lt;/code&gt; option on $.connection.hub.start(). This tells SignalR if you want to wait for the page to load before starting your connection which in my case I don’t. Simply set that option to &lt;code&gt;false&lt;/code&gt; and it will start the connection when invoked instead of waiting. This fixed my issues and SignalR and RequireJS started playing nice together. Note: I am also using a callback on start() to make sure my connection has been established before using my server methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;waitForPageLoad&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// callback code&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tech</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Setup todo.txt CLI on OSX with Homebrew and Dropbox</title>
      <dc:creator>Cameron Wardzala</dc:creator>
      <pubDate>Thu, 20 Sep 2012 15:58:00 +0000</pubDate>
      <link>https://dev.to/cwardzala/setup-todotxt-cli-on-osx-with-homebrew-and-dropbox-60i</link>
      <guid>https://dev.to/cwardzala/setup-todotxt-cli-on-osx-with-homebrew-and-dropbox-60i</guid>
      <description>&lt;p&gt;I have recently re-discovered &lt;a href="http://todotxt.com"&gt;todo.txt&lt;/a&gt; the handy plain text todo list, along with its CLI. I have fallen in love with this method for keeping to-do lists, it's taggable and has search capabilities too! One of the biggest pain points for me getting started was installing the CLI and hooking it up to Dropbox for cross-platform sharing. The todo.txt docs don't provide much of a step by step getting started for OSX with homebrew, they merely say go install with homebrew and then you have to dig through the Tips and Tricks to find what different params to setup to customize your experience.&lt;/p&gt;

&lt;p&gt;This article will walk you through setting up &lt;a href="http://todotxt.com"&gt;todo.txt&lt;/a&gt; CLI on OSX with Homebrew and storing your todo.txt files in Dropbox for use across multiple platforms.&lt;/p&gt;

&lt;p&gt;Heads up! make sure to change any &lt;code&gt;&amp;lt;your username&amp;gt;&lt;/code&gt; to your OSX username&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install todo.txt CLI with homebrew using this command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ brew install todo-txt&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a folder in your Dropbox folder called “todo”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create the following files in your new folder in your Dropbox folder&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;todo.txt&lt;/li&gt;
&lt;li&gt;todo.txt.bak&lt;/li&gt;
&lt;li&gt;report.txt&lt;/li&gt;
&lt;li&gt;done.txt
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or from the command-line, you could &lt;code&gt;cd&lt;/code&gt; into your new folder and run this command instead&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ touch todo.txt todo.txt.bak report.txt done.txt&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make a copy of the todo.cfg in your new Dropbox folder&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cp /usr/local/Cellar/todo-txt/2.9/todo.cfg $HOME/Dropbox/todo&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update your new todo.cfg file to reflect the location of your todo directory. This should be on line 4 change &lt;code&gt;/Users/gina/Documents/todo&lt;/code&gt; to &lt;code&gt;$HOME/Dropbox/todo&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update your &lt;code&gt;~/.bash_profile&lt;/code&gt; with these lines&lt;/p&gt;

&lt;p&gt;&lt;code&gt;source /usr/local/Cellar/todo-txt/2.9/etc/bash_completion.d/todo_completion&lt;br&gt;
complete -F _todo t&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias t='/usr/local/Cellar/todo-txt/2.9/bin/todo.sh -d $HOME/Dropbox/todo/todo.cfg'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will give you the shortcut of &lt;code&gt;t&lt;/code&gt; so you don't have to type todo.sh every time. It will also add tab complete to for &lt;code&gt;t&lt;/code&gt; as well.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart your terminal and you should now be able to add tasks using&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ t add “My first task”&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more info about todo.txt see &lt;a href="http://todotxt.com"&gt;http://todotxt.com&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
