<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Mumblings from the code swamp. Find my more interesting online-ness at zeke.sikelianos.com.</description><title>Zeke Sikelianos</title><generator>Tumblr (3.0; @zeke)</generator><link>http://zeke.tumblr.com/</link><item><title>Encouraging Users to Drop IE</title><description>&lt;p&gt;After a few days struggling to make a recent project look right on Internet Explorer, I set about trying to find a graceful way of notifying users that they need to upgrade. I played with a &lt;a href="http://nspeaks.com/699/kill-ie6-now/"&gt;shit-ton of pre-existing solutions&lt;/a&gt;, but in the end I decided to whip up something much more basic that I can easily integrate into any Rails app:&lt;/p&gt;

&lt;script src="http://gist.github.com/246658.js?file=warn_ie_users.rb"&gt;&lt;/script&gt;</description><link>http://zeke.tumblr.com/post/265291033</link><guid>http://zeke.tumblr.com/post/265291033</guid><pubDate>Tue, 01 Dec 2009 13:24:30 -0800</pubDate></item><item><title>"If you’re not familiar with what makes a valid Rack application it basically comes down to an object..."</title><description>“If you’re not familiar with what makes a valid Rack application it basically comes down to an object that receives the “call” method with exactly one argument, the environment hash, and returns an array with exactly 3 elements. The status, headers and body.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://github.com/hassox/pancake"&gt;Pancake Documentation&lt;/a&gt;&lt;/em&gt;</description><link>http://zeke.tumblr.com/post/263780971</link><guid>http://zeke.tumblr.com/post/263780971</guid><pubDate>Mon, 30 Nov 2009 11:44:58 -0800</pubDate></item><item><title>Mac Users: Extract Frames from Animated GIFs with Preview.app</title><description>&lt;p&gt;Animated GIFs are kind of a relic these days, but when you need to crack one open and get at its individual frames, you might think Photoshop is that way to go. Alas, Photoshop doesn’t support animated GIFs (any more).&lt;/p&gt;

&lt;p&gt;But! It turns out &lt;a href="http://en.wikipedia.org/wiki/Preview_%28software%29"&gt;Preview.app&lt;/a&gt; does. You just open the GIF and drag the frames right out of it. Handy.&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/227754583</link><guid>http://zeke.tumblr.com/post/227754583</guid><pubDate>Fri, 30 Oct 2009 00:58:12 -0700</pubDate></item><item><title>Testing HTTP Basic Auth in Sinatra</title><description>&lt;script src="http://gist.github.com/221971.js"&gt;&lt;/script&gt;&lt;p&gt;Snagged from &lt;a href="http://www.sinatrarb.com/faq.html#test_http_auth"&gt;http://www.sinatrarb.com/faq.html#test_http_auth&lt;/a&gt;&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/227385742</link><guid>http://zeke.tumblr.com/post/227385742</guid><pubDate>Thu, 29 Oct 2009 17:06:52 -0700</pubDate></item><item><title>HTML Form Submission with button/image Combo</title><description>&lt;p&gt;When you submit an HTML form using &lt;code&gt;&lt;input type="image"&gt;&lt;/code&gt;, the x and y coordinates of the image get passed along as GET parameters in the URL. I can never seem to remember how to avoid this, so here’s a snippet for reference:&lt;/p&gt;

&lt;script src="http://gist.github.com/221257.js"&gt;&lt;/script&gt;</description><link>http://zeke.tumblr.com/post/226752098</link><guid>http://zeke.tumblr.com/post/226752098</guid><pubDate>Thu, 29 Oct 2009 01:06:00 -0700</pubDate></item><item><title>script/console for Sinatra</title><description>&lt;p&gt;Wishing you had a Rails-like console for your Sinatra app? Welp, &lt;a href="http://blog.zerosum.org/"&gt;zapnap&lt;/a&gt; has implemented a nice solution into his vanilla &lt;a href="http://github.com/zapnap/sinatra-template"&gt;sinatra-template&lt;/a&gt; on github, based on code from &lt;a href="http://barkingiguana.com/2009/01/25/scriptconsole-for-your-application/"&gt;barking iguana&lt;/a&gt;. Happy consolation!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update: Check out &lt;a href="http://github.com/sickill/racksh"&gt;racksh&lt;/a&gt;, a console for Rack-based ruby web applications, including Rails, Merb, Sinatra, Camping, Ramaze, or even your own framework.&lt;/strong&gt;&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/223426811</link><guid>http://zeke.tumblr.com/post/223426811</guid><pubDate>Sun, 25 Oct 2009 20:13:00 -0700</pubDate></item><item><title>Lessons learned on my first date with DataMapper</title><description>&lt;p&gt;Today I started playing around with &lt;a href="http://datamapper.org/"&gt;DataMapper&lt;/a&gt;, an up-and-coming ORM that’s popular among the Merb/Sinatra kids, and one that’s making its way into Rails 3 as an alternative to ActiveRecord. Here are some notes from day one:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Different Database Column Defaults&lt;/strong&gt;: The default String size is 50 characters, unlike ActiveRecord which defaults to 255 (for MySQL, anyway)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strategic Eager Loading&lt;/strong&gt;: At first I was dismayed to find there’s no &lt;code&gt;:include&lt;/code&gt; option for nesting associations in a query. Then I realized it’s not necessary! DataMapper will only issue the very bare minimums of queries to your data-store that it needs to. Read more about it &lt;a href="http://datamapper.org/why.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serialization&lt;/strong&gt;: DataMapper is intended to have a lean and minimalistic core, which provides the minimum necessary features for an ORM. In order to successfully convert an array of objects to JSON (or XML or CSV or YAML), you’ll need to get the &lt;a href="http://github.com/datamapper/dm-more/tree/master/dm-serializer"&gt;dm-more gem&lt;/a&gt; and drop a &lt;code&gt;require 'dm-serializer'&lt;/code&gt; in your app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scopes&lt;/strong&gt;: As with eager loading, DataMapper is smart about reducing the number of queries it makes. Check this out:&lt;/p&gt;

&lt;script src="http://gist.github.com/215776.js"&gt;&lt;/script&gt;&lt;p&gt;So far, I’m finding DataMapper to be smart and intuitive. Here’s to day two..&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/219755590</link><guid>http://zeke.tumblr.com/post/219755590</guid><pubDate>Wed, 21 Oct 2009 23:02:58 -0700</pubDate></item><item><title>Sinatra Extension: Ratpack</title><description>&lt;p&gt;As soon as I started using &lt;a href="http://www.sinatrarb.com/"&gt;Sinatra&lt;/a&gt;, I felt naked without those handy ActionView helpers from Rails like &lt;code&gt;stylesheet_link_tag&lt;/code&gt;, &lt;code&gt;javascript_include_tag&lt;/code&gt;, &lt;code&gt;link_to&lt;/code&gt;, etc. So today I read up a little on &lt;a href="http://www.sinatrarb.com/extensions.html"&gt;how to write Sinatra Extensions&lt;/a&gt; and put together the beginnings of a gem to address the need.&lt;/p&gt;

&lt;p&gt;Here are the methods implemented so far..&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;content_tag&lt;/li&gt;
&lt;li&gt;convert_to_list_items&lt;/li&gt;
&lt;li&gt;image_tag&lt;/li&gt;
&lt;li&gt;javscript_include_tag&lt;/li&gt;
&lt;li&gt;link_to&lt;/li&gt;
&lt;li&gt;stylesheet_link_tag&lt;/li&gt;
&lt;li&gt;tag&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So if you’re a Rails developer that’s getting familiar with Sinatra, you may want to check Ratpack out: &lt;a href="http://github.com/zeke/ratpack/"&gt;http://github.com/zeke/ratpack/&lt;/a&gt;&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/219740949</link><guid>http://zeke.tumblr.com/post/219740949</guid><pubDate>Wed, 21 Oct 2009 22:38:39 -0700</pubDate></item><item><title>"Criticism may not be agreeable, but it is necessary. It fulfills the same function as pain in the..."</title><description>“Criticism may not be agreeable, but it is necessary. It fulfills the same function as pain in the human body. It calls attention to an unhealthy state of things.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Winston Churchill&lt;/em&gt;</description><link>http://zeke.tumblr.com/post/211279622</link><guid>http://zeke.tumblr.com/post/211279622</guid><pubDate>Mon, 12 Oct 2009 12:39:09 -0700</pubDate></item><item><title>Access the 'clicked' item within a jQuery function.</title><description>&lt;p&gt;I always seem to forget this, but the proper syntax is &lt;code&gt;$(this)&lt;/code&gt;:&lt;/p&gt;

&lt;script src="http://gist.github.com/207455.js"&gt;&lt;/script&gt;</description><link>http://zeke.tumblr.com/post/209841553</link><guid>http://zeke.tumblr.com/post/209841553</guid><pubDate>Sat, 10 Oct 2009 21:57:07 -0700</pubDate></item><item><title>New Rails Plugin: Autoform</title><description>&lt;p&gt;I’m currently working on a Rails project that has lots of models that all need basic  &lt;a href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete"&gt;CRUD&lt;/a&gt;ability, but the forms and views don’t need to be fancy, as the app is used primarily as an XML webservice. We need the CRUD so we can tweak content here and there, but it’s not public-facing. I got tired of having to update the forms every time I wrote a migration, so I created Autoform.&lt;/p&gt;

&lt;p&gt;Autoform is a Rails plugin that makes it easy to dynamically auto-generate a form for an ActiveRecord object. It cycles through all columns in the model and generates semantically correct form output with labels. Think of Autoform as a scaffolder that automatically keeps your forms current as you make changes to your model.&lt;/p&gt;

&lt;p&gt;Check it out at &lt;a href="http://github.com/zeke/autoform/tree/master"&gt;github.com/zeke/autoform&lt;/a&gt;&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/185640373</link><guid>http://zeke.tumblr.com/post/185640373</guid><pubDate>Fri, 11 Sep 2009 16:02:07 -0700</pubDate></item><item><title>Audio</title><description>&lt;embed type="application/x-shockwave-flash" src="http://zeke.tumblr.com/swf/audio_player.swf?audio_file=http://www.tumblr.com/audio_file/180161305/tumblr_kphepein3M1qz7mgs&amp;color=FFFFFF" height="27" width="207" quality="best"&gt;&lt;/embed&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://zeke.tumblr.com/post/180161305</link><guid>http://zeke.tumblr.com/post/180161305</guid><pubDate>Fri, 04 Sep 2009 21:48:50 -0700</pubDate></item><item><title>A Coupla Handy Tools for working with XML</title><description>&lt;p&gt;&lt;strong&gt;Camino&lt;/strong&gt;&lt;br/&gt;
If you’re on a Mac, the &lt;a href="http://caminobrowser.org/"&gt;Camino&lt;/a&gt; web browser is a good buddy. It’s great for those times when you want a fast, lean browser without the frills. One of its &lt;a href="http://caminobrowser.org/features/"&gt;many perks&lt;/a&gt; is that it displays XML nicely (unlike Firefox and Safari), with syntax highlighting and little toggle buttons for expanding and collapsing elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;hurl&lt;/strong&gt;&lt;br/&gt;
One of the coolest things to come out of this year’s &lt;a href="http://r09.railsrumble.com/entries"&gt;railsrumble&lt;/a&gt; competition is &lt;a href="http://hurl.r09.railsrumble.com/"&gt;hurl&lt;/a&gt;. It’s a simple tool that helps you test APIs. “Choose the request method, customize headers and POST parameters, add basic authorization, and even follow redirects. Then view the nicely formatted request and response.” Check out the &lt;a href="http://hurl.r09.railsrumble.com/about/"&gt;demo screencast&lt;/a&gt; for a quick rundown.&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/175670323</link><guid>http://zeke.tumblr.com/post/175670323</guid><pubDate>Sun, 30 Aug 2009 13:13:00 -0700</pubDate><category>xml</category><category>camino</category><category>hurl</category><category>api</category><category>mac</category></item><item><title>Adding non-columnar data to Rails XML and JSON feeds</title><description>&lt;p&gt;ActiveRecord offers handy &lt;code&gt;to_xml&lt;/code&gt; and &lt;code&gt;to_json&lt;/code&gt; methods for converting AR objects to XML or JSON format. Today I discovered that you can easily add values from model methods to the output, like so..&lt;/p&gt;

&lt;script src="http://gist.github.com/177323.js"&gt;&lt;/script&gt;&lt;p&gt;See &lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/Serialization.html"&gt;Module::ActiveRecord::Serialization&lt;/a&gt; for more info.&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/174266764</link><guid>http://zeke.tumblr.com/post/174266764</guid><pubDate>Fri, 28 Aug 2009 16:47:47 -0700</pubDate><category>activerecord</category><category>rails</category><category>xml</category><category>json</category><category>serialization</category></item><item><title>How to Suppress Adobe Debugger's Exception Alerts</title><description>&lt;p&gt;If you’re a Flash developer and have the Debugger Version of Adobe Flash Player installed, you’ve probably noticed that it periodically pops up annoying alerts when you browse the web. They are the result of poor exception handling by the Actionscript/Flex programmers of the world. To disable the alerts, open up your &lt;a href="http://livedocs.adobe.com/flex/3/html/help.html?content=logging_04.html"&gt;mm.cfg&lt;/a&gt; and add this line:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SuppressDebuggerExceptionDialogs=1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You’ll probably need to restart your browser for the change to take effect. That’s it!&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/169910298</link><guid>http://zeke.tumblr.com/post/169910298</guid><pubDate>Sun, 23 Aug 2009 14:18:00 -0700</pubDate><category>as3</category><category>flex</category><category>debugging</category><category>flash</category><category>adobe</category><category>swf</category></item><item><title>A new twist on 'link_to_unless_current'</title><description>&lt;p&gt;I’ve been thinking it would be nice to have a smarter alternative to Rails’ &lt;a href="http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M001884"&gt;&lt;code&gt;link_to_unless_current&lt;/code&gt;&lt;/a&gt; view helper: rather than being relegated to plain old text, the active link should remain a link and get a CSS class of &lt;code&gt;active&lt;/code&gt; tacked onto it, so it can be styled to stand out from its siblings. It’s more intuitive for a link to always be a link, even if it’s a link to the current page. Dig?&lt;/p&gt;

&lt;script src="http://gist.github.com/135018.js"&gt;&lt;/script&gt;&lt;p&gt;At first I tried to do some &lt;code&gt;alias_method&lt;/code&gt; magic to override the &lt;code&gt;link_to&lt;/code&gt; function, but in the end I think naming the method &lt;code&gt;link&lt;/code&gt; is not only shorter but safer!&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/129164334</link><guid>http://zeke.tumblr.com/post/129164334</guid><pubDate>Tue, 23 Jun 2009 21:54:00 -0700</pubDate><category>rails</category><category>ruby</category><category>helpers</category><category>css</category></item><item><title>Request methods in Rails</title><description>&lt;p&gt;I seem to have a hard time remembering all the request methods in Rails. For anyone else who has the same problem, you might wanna bookmark the Rails API page on &lt;a href="http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html"&gt;Class
ActionController::AbstractRequest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here’s a handy helper method for getting your application’s base URL:&lt;/p&gt;

&lt;script src="http://gist.github.com/122549.js"&gt;&lt;/script&gt;</description><link>http://zeke.tumblr.com/post/116954326</link><guid>http://zeke.tumblr.com/post/116954326</guid><pubDate>Tue, 02 Jun 2009 13:20:29 -0700</pubDate></item><item><title>Specifying CSS Class for a Textile list</title><description>&lt;p&gt;A nice little trick I learned today. Works for ordered lists too..&lt;/p&gt;

&lt;script src="http://gist.github.com/118366.js"&gt;&lt;/script&gt;</description><link>http://zeke.tumblr.com/post/113474348</link><guid>http://zeke.tumblr.com/post/113474348</guid><pubDate>Tue, 26 May 2009 16:46:46 -0700</pubDate></item><item><title>Manipulating Checkboxes with jQuery</title><description>&lt;p&gt;When selecting elements with jQuery, you can’t simply append &lt;code&gt;.checked&lt;/code&gt; to a checkbox element to determine whether or not its checked; you have to use the &lt;code&gt;attr&lt;/code&gt; array or the &lt;a href="http://docs.jquery.com/Traversing/is#expr"&gt;&lt;code&gt;is&lt;/code&gt;&lt;/a&gt; expression evaluator, like so..&lt;/p&gt;

&lt;script src="http://gist.github.com/118310.js"&gt;&lt;/script&gt;&lt;p&gt;Find more info on this at &lt;a href="http://www.electrictoolbox.com/check-uncheck-checkbox-jquery/"&gt;Electric Toolbox&lt;/a&gt;&lt;/p&gt;</description><link>http://zeke.tumblr.com/post/113417669</link><guid>http://zeke.tumblr.com/post/113417669</guid><pubDate>Tue, 26 May 2009 14:28:29 -0700</pubDate></item><item><title>jQuery fadeToggle() Function</title><description>&lt;p&gt;This little function works just like jQuery’s built-in slideToggle(). It’s a nice alternative to the toggle(‘normal’) function, which expands and collapses elements by squishing/stretching them horizontally and vertically.&lt;/p&gt;

&lt;script src="http://gist.github.com/118237.js"&gt;&lt;/script&gt;</description><link>http://zeke.tumblr.com/post/113368926</link><guid>http://zeke.tumblr.com/post/113368926</guid><pubDate>Tue, 26 May 2009 12:25:27 -0700</pubDate></item></channel></rss>
