RocketModule blogs http://rocket.local/blog Caleb Gilbert | Drupal Development/Programming en "Get Involved: JavaScript and Single Page Apps" presentation slides http://rocket.local/blog/get-involved-javascript-and-single-page-apps-presentation-slides <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Slides from a presentation I gave for the December 2013 JavaScript and Single Page Web Apps meetup, at HackerLab in Sacramento, California.</p> <iframe src="//slid.es/calebgilbert/sacramento-javascript-web-apps-slides/embed" width="576" height="420" scrolling="no" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe></div></div></div> Wed, 18 Dec 2013 05:52:21 +0000 Caleb Gilbert 142 at http://rocket.local http://rocket.local/blog/get-involved-javascript-and-single-page-apps-presentation-slides#comments Backbone.js IS opinionated, or why is using nested models and collections in Backbone so hard? http://rocket.local/blog/backbonejs-opinionated-or-why-using-nested-models-and-collections-backbone-so-hard <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><strong>Background</strong><br /> So after diving into the subject of nested models/collections in Backbone.js and being very frustrated at how Backbone doesn't handle them, I eventually discovered <a href="https://github.com/powmedia/backbone-deep-model/issues/14#issuecomment-15687361">a comment</a> by Backbone.js creator, Jeremy Ashkenas on GitHub:</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/backbonejs" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Backbone.js</a></div><div class="field-item odd"><a href="/categories/javascript" typeof="skos:Concept" property="rdfs:label skos:prefLabel">JavaScript</a></div><div class="field-item even"><a href="/categories/nosql" typeof="skos:Concept" property="rdfs:label skos:prefLabel">noSQL</a></div></div></div> Fri, 04 Oct 2013 05:21:12 +0000 Caleb Gilbert 141 at http://rocket.local http://rocket.local/blog/backbonejs-opinionated-or-why-using-nested-models-and-collections-backbone-so-hard#comments Drupal 8 architecture decisions: standing on the shoulders of giants. http://rocket.local/blog/drupal-8-architecture-decisions-standing-shoulders-giants <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Until recently I've been less than enthusiastic about Drupal 8, but I've changed my tune (and of course nothing is perfect; I am still a bit concerned/sad that Drupal 8 could possibly be leaving some smaller sites behind, but this is a ship that has likely sailed, so c'est la vie).</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div><div class="field-item odd"><a href="/categories/oop" typeof="skos:Concept" property="rdfs:label skos:prefLabel">OOP</a></div><div class="field-item even"><a href="/categories/design-patterns" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Design patterns</a></div></div></div> Wed, 11 Sep 2013 06:03:28 +0000 Caleb Gilbert 140 at http://rocket.local http://rocket.local/blog/drupal-8-architecture-decisions-standing-shoulders-giants#comments Introducing ScrapeGrid http://rocket.local/blog/introducing-scrapegrid <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><style> .page-node-136 .title { display:none; } .video-container { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; } .video-container iframe, .video-container object, .video-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style><p><img src="/sites/all/themes/higher_responsive/images/higher_images/scrapegrid-logotype.png" alt="" title="ScrapeGrid"><br /> Grab snippets from multiple webpages and assemble, save, and load them all in a customized display grid.</p> <div class="video-container" style="text-align:center"> <iframe frameborder="0" width="720" height="480" src="//www.youtube.com/embed/KQGicXHOWv0?rel=0&showinfo=0&vq=hd720" allowfullscreen></iframe></div> <p>Many of us have a handful of pages we revisit many times throughout a single day. What if instead of needing many separate tabs for all your pages, you could grab just the part you actually focus on for each page and then display all these different focal points from all these different pages in a single tab? This is exactly what ScrapeGrid does.</p> <p>Works in your browser. No plugins. Coming soon.</p> <p>Watch the preview and <a href="http://preview.layout.io/">sign up</a> for news and updates.</p> </div></div></div> Mon, 12 Aug 2013 16:43:06 +0000 Caleb Gilbert 136 at http://rocket.local http://rocket.local/blog/introducing-scrapegrid#comments Build your own JavaScript framework http://rocket.local/blog/build-your-own-javascript-framework <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I've happily reached a significant milestone in the development of my project, finishing a foundational layer that by itself could be valid to open source at some point.</p> <p>Also:</p> <ul><li style="padding:0 0 10px 0;">In my last post I explained my reasons for passing on the current crop of JavaScript frameworks. This is a decision that I've been extremely pleased with, as I've managed to conceive/implement my own MVC/MVVM pattern for the project and the endeavor has pushed me much further into my JavaScript education.</li> <li style="padding:10px 0;">I have refactored the codebase from using 100% jQuery to about 80% raw JavaScript to 20% jQuery. It is nice to be able to know how to step outside of jQuery and/or deepen one's appreciation for what jQuery is doing under the hood. Also, if you've spent any time on jsperf.com at all you probably know that <a href="http://jsperf.com/comparing-jquery-and-native-js/11#bs-results">jQuery is much slower than raw JavaScript</a> for many things. When building an almost-entirely client-side app, speed starts to matter much more than when you have just a couple jQuery snippets on a page, and I want this app to be whip quick. It was a little ackward getting started with plain JS, but once underway I caught the hang of it fairly quickly, and the end result I'm definitely happy with.</li> <li style="padding:10px 0;">Currently, I am using <a href="https://developer.mozilla.org/en-US/docs/DOM/Storage">localStorage</a> for my data store, and it's been working great for development purposes - it's basically a mock mongoDB for me (I'm storing nested objects in localStorage using a small jQuery library called <a href="https://github.com/andris9/jStorage">jStorage</a>). I'm purposely putting off the server side of this application because I want to be able to use the Symfony 2.3 LTS release, which is scheduled for May as middleware between the client-side and mongoDB. The temptation to use node.js is strong, and arguably would be the most performant option, but the reasons for picking Symfony are probably obvious to any Drupal developer.</li> <li style="padding:10px 0;">Finally, don't forget - if you are using regex to parse the DOM, you're doing it <a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454">brain-meltingly wrong</a>!</li> </ul><p>Cheers all, I'm off to <a href="http://sacdrupal.org/">DrupalCamp Sacramento</a> for the weekend.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/javascript" typeof="skos:Concept" property="rdfs:label skos:prefLabel">JavaScript</a></div><div class="field-item odd"><a href="/categories/drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div><div class="field-item even"><a href="/categories/symfony" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Symfony</a></div></div></div> Sat, 13 Apr 2013 02:46:46 +0000 Caleb Gilbert 129 at http://rocket.local http://rocket.local/blog/build-your-own-javascript-framework#comments Javascript Framework Redux http://rocket.local/blog/javascript-framework-redux <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><em>Part II in a series of articles about an online web application I am working on. <a href="/blog/side-project-part-1-getting-started">Read Part I</a></em></p> <p>I'm am currently in the process of making my own web service, which will have a single-page-app (SPA) type of structure/interface. This is exactly the type of project that the bevy of JavaScript frameworks like Backbone.js, Angularjs, Ember.js, Knockout.js, and Meteor are build for, thus I've taken it for granted that I would use one of these frameworks as the client-side infrastructure for my app. After much review and fiddling around it turns out that I will not be using one of them. At least not for now. Below are some of reasons why <em>(note these reasons may not apply to you, you may rightly decide that a Javascript framework is a great choice for your project(s) - these are one person's opinions only)</em>:</p> <h3>Using any of the frameworks requires more commitment from my code base than I want to give right now</h3> <p>One of my biggest surprises/disappointments after spending a lot of time with Backbone.js and Angularjs was realizing that my (imho) perfectly awesome JavaScript/jQuery foundation layer, which I just slaved over creating, would not only have to be modified - it would have to be thrown out the window. This is because none of these frameworks are a container for your JavaScript - they are a replacement for it. Sure you might use a little bit of JavaScript/jQuery within any one of the frameworks, but overall you'll be doing-Backbone, or doing-Angular, or doing-Ember, or whatever. It's even common advice for Angular experts to tell newbies to not use jQuery at all while they are getting started, so that they can learn the 'Angular way'. Thanks, but no thanks.</p> <p>I don't want to abandon my universally usable and performant JavaScript/jQuery that I can take and integrate easily into almost anything (well almost anything but these frameworks, apparently). Maybe in the future as one of the JS frameworks becomes more mature and dominant I will reconsider. Honestly, I think a platform would have be as ubiquitous as jQuery has grown to be, for me to volunteer myself for platform lock-in on the level these frameworks require now.</p> <h3>I want to continue building my expertise in JavaScript/jQuery themselves and don't want to have it abstracted away from me</h3> <p>This is a big one for me. I can do what needs to be done with JavaScript, even reasonably well on a case by case basis. But I want to really master it. I don't want to just know Angular, or Backbone. I want to come up with solutions for the real-world, big-picture DOM/JS obstacles that I run into, presumably like the makers of the Javascript frameworks did. I want to eventually have the knowledge that I *could* make my own framework. And at that point, even if I decide to use someone else's framework I will have much more appreciation for my choice, and I will have more knowledge for how to leverage it.</p> <h3>Who are the frameworks a good choice for?</h3> <p>Don't get me wrong I am really glad I spent the time I did looking into Backbone.js and Angularjs (I actually looked at others, but I spent the most time with Backbone and Angular). They are demystified for me now, and there are a lot of good bits, patterns, and big-picture issues that I'm more informed about now than I was previously. I can easily imagine that someone who isn't a JavaScript expert and who just wants to commit to learning the idiosyncrasies of one of the frameworks can build some really great stuff. I can also imagine that true JavaScript masters might be taking their knowledge and one of these frameworks to bring their projects to an even higher level of organization and efficiency (though I'd actually be interested in hearing from the John Resigs of the world regarding their thoughts on current framework implementations).</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/javascript" typeof="skos:Concept" property="rdfs:label skos:prefLabel">JavaScript</a></div><div class="field-item odd"><a href="/categories/drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div><div class="field-item even"><a href="/categories/jquery" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Jquery</a></div></div></div> Mon, 01 Apr 2013 18:06:12 +0000 Caleb Gilbert 128 at http://rocket.local http://rocket.local/blog/javascript-framework-redux#comments A Side Project: Part 1, Getting Started http://rocket.local/blog/side-project-part-1-getting-started <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><em>"A Side Project" is a series of articles about an online web application I am working on. In Part 1 I share some of the thoughts and motivations which brought me to starting this project in the first place.</em></p> <p><img src="http://highervisibilitywebsites.com/files/newnold.jpg" alt="" style="float:right; margin: 0 0 0 .9em;" /><br /><strong>The seed for what is new, has some old roots</strong><br /> In 2005 I became involved with <a href="http://drupal.org">Drupal</a> after discovering it in the course of working on an ambitious <em>side project</em> of mine. It was a discovery that would change my life, professionally and otherwise, much for the better. Ironically, the very thing, which got me into Drupal in the first place (e.g., online side projects) had became one of the unfortunate casualties in more recent years as my professional Drupal activities increased. Sure, I had little projects - went to meetups, cons, made some patches here, contributed this there - but building my own online site/service from the ground up with the intention/hope of achieving something big, that went by the wayside.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div><div class="field-item odd"><a href="/categories/web-apps" typeof="skos:Concept" property="rdfs:label skos:prefLabel">web apps</a></div><div class="field-item even"><a href="/categories/saas" typeof="skos:Concept" property="rdfs:label skos:prefLabel">SaaS</a></div><div class="field-item odd"><a href="/categories/javascript" typeof="skos:Concept" property="rdfs:label skos:prefLabel">JavaScript</a></div></div></div> Tue, 19 Mar 2013 05:17:11 +0000 Caleb Gilbert 126 at http://rocket.local http://rocket.local/blog/side-project-part-1-getting-started#comments Example Varnish VCL for a Drupal / Pressflow site http://rocket.local/blog/example-varnish-vcl-drupal-pressflow-site <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><img src="http://highervisibilitywebsites.com/files/varnish-logo-red-64.gif" style="float:right; margin: 3px;" alt="" />A few months ago I set up Varnish on my Macbook Pro and have deployed it for a production site which serves anonymous and (a lot of) authenticated users. Initially, I spent a couple months just running it in my local environment, including backporting the <a href="http://drupal.org/project/Varnish">Varnish.module</a> to Drupal 5. In retrospect, I'm glad that I spent the time to learn how Varnish and it's configuration file works before deploying it, as it's paid off in a big way as our production site now has something which is equivalent to:</p> <ul><li>...an in-memory static file server for all users (e.g., the equivalent of hooking up something like nginx or <a href="/scaling-drupal-benchmarking-static-file-serving-lighttpd-and-browser-pipelining">lighttpd</a> as a front end to Apache (or whatever you're using).</li> <li>...an in-memory boost.module in terms of database-relief for anonymous users.</li> </ul><p>Contrary to popular belief the two items above are in no way an automatic benefit of simply installing Varnish. If the configuration file, and Drupal installation, is not massaged with care one definitely won't get the database relief from anonymous page caching, and the benefits from Varnish-as-a-static-file server will not nearly be optimized. Bottom line Varnish can be a temperamental piece of software. It only gives back what you put into it.</p> <p>To this end, the settings in the Varnish VCL file can make or break whether you get a substantial benefit from it. Below is an example VCL file, which was formed from a good amount of research and a lot of trial and error:</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div><div class="field-item odd"><a href="/categories/performance" typeof="skos:Concept" property="rdfs:label skos:prefLabel">performance</a></div><div class="field-item even"><a href="/categories/varnish" typeof="skos:Concept" property="rdfs:label skos:prefLabel">varnish</a></div><div class="field-item odd"><a href="/categories/pressflow" typeof="skos:Concept" property="rdfs:label skos:prefLabel">pressflow</a></div></div></div> Tue, 18 May 2010 20:14:39 +0000 Caleb Gilbert 103 at http://rocket.local http://rocket.local/blog/example-varnish-vcl-drupal-pressflow-site#comments Some highlights from Drupalcon San Francisco http://rocket.local/blog/some-highlights-drupalcon-san-francisco <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Drupalcon San Francisco was great. Here is some of what stood out to me, in no particular order:</p> <ul><li>Tim O'Reilly's keynote was great (see link for it in comments). It put perspective on where Drupal fits into the larger world and reminded me that I actually came to Drupal for a reason, not just for technology or Drupal itself. While listening to the keynote, I couldn't help but think that Dries' personal push for RDF in core (which I've seen some head-scratching about from some) might owe part of its genesis to his own talks with O'Reilly.</li> <li>The presentation <a href="http://sf2010.drupal.org/conference/sessions/you-shall-not-pass-managing-expectations-and-boundaries-clients">YOU SHALL NOT PASS: Managing Expectations and Boundaries of Clients</a> is one of the hidden gems of Drupalcon. If you're not project managing your clients/work the way they describe, you're doing it wrong (or at least for less money, more aggravation, and less satisfaction!).</li> <li>Larry Garfield's session <a href="http://sf2010.drupal.org/conference/sessions/objectifying-php">Objectifying PHP</a> was a wonderful session for anyone who is ready to move to the next level with object oriented methods (pun intended) and practices.</li> <li>The money, as well as the number of people, and type of people involved with Drupal these days has definitely changed the feel of the conference as compared to earlier ones I've attended. This is true even comparing it to DC which was only last year, let alone the first one I went to 4 years ago (OSCMS). There is no good or bad implied here, just worth noting since it has implications (and things will likely continue in this direction for a while).</li> <li>For the past year or so it's been cliche to say, 'No one person one can know everything about Drupal anymore'. For me the new saying is, 'No one person would even *want* to know everything about Drupal anymore'. There are vast, vast knowledge areas within Drupal that have their own following, experts, and activity levels. Don't get me wrong, it's *all* extremely interesting, but gazooks...</li> <li>For now videos/screencasts for presentations (they don't all seem to have them) can be found by going to <a href="http://sf2010.drupal.org/conference/sessions">this page</a> and clicking through to the individual presentation page you're interested in. UPDATE: <a href="http://www.archive.org/search.php?query=DrupalCon&amp;sort=-publicdate">Videos posted here too</a>.</li> <li>Hottest Drupal-related career: Project/QA manager. The need for developers and themers, is plenty hot of course, but I'd be willing to bet that at least some of the larger Drupal-based companies/shops would choose a competent project/QA manager over a competent developer if forced to choose only one.</li> <li>The way <a href="http://sf2010.drupal.org/conference/sessions/page-render-drill-down-drupal-7">Drupal 7's $page array, hook_page_alter, and drupal_render works</a>, simultaneously makes me want to use Drupal 7 RIGHT DARN NOW, as well as makes me wonder just how horrifically these features will be abused. (who needs a custom theme anymore - Garland with a bunch of hook_page_alters should work just fine, right) ;)</li> <li>If you want the sneak peak for the next North American Drupalcon, <a href="http://chicago2011.drupal.org/">look no further</a>.</li> </ul><p>If you have a highlight you'd like to share please leave a comment.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div><div class="field-item odd"><a href="/categories/drupalcon" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupalcon</a></div></div></div> Thu, 22 Apr 2010 22:21:36 +0000 Caleb Gilbert 102 at http://rocket.local http://rocket.local/blog/some-highlights-drupalcon-san-francisco#comments Install intl PHP extension for MAMP / Symfony2 http://rocket.local/blog/install-intl-php-extension-mamp-symfony2 <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Many Bothans died to bring us this information (or at least my patience died a small death). Stashing this here for next time and/or to help someone else hopefully.</p> <p>First do:</p> <div class="codeblock"><code>export PATH=/Applications/MAMP/bin/php/php5.3.14/bin/:$PATH<br />brew update<br />brew install icu4c</code></div> <p>Next <a href="http://php.net/releases/index.php">download PHP source</a> that matches your MAMP version.</p> <p>Then:</p> <div class="codeblock"><code>cd /Applications/MAMP/bin/php/php5.3.14 <br />mkdir include <br />mv ~/Downloads/php-5.3.14 include/php <br />cd include/php<br />sudo ./configure<br />pecl install intl</code></div> <p>Finally, add "extension=intl.so" to your php.ini and restart Apache</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Categories:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/categories/snippet" typeof="skos:Concept" property="rdfs:label skos:prefLabel">snippet</a></div><div class="field-item odd"><a href="/categories/php" typeof="skos:Concept" property="rdfs:label skos:prefLabel">php</a></div></div></div> Sat, 20 Mar 2010 01:08:17 +0000 Caleb Gilbert 127 at http://rocket.local http://rocket.local/blog/install-intl-php-extension-mamp-symfony2#comments