Account: (login)

More Channels


Are you the publisher? Claim this channel

Search in 126,069,113 RSS articles:

Channel Description:

Web Freshness

Latest Articles in this Channel:

  • 03/26/09--16:54: Decoupling ActionScript and JavaScript (chan 3115512)
  • ActionScript’s ExternalInterface is a powerful tool, allowing you to execute and retrieve results from JavaScript in the browser. Recently however, a strange bug was encountered where Flash running in one part of a page was exhibiting strange rendering issues, such as pieces of the background failing to draw, and Sprites flickering when ExternalInterface calls were made. [...]

  • 06/23/09--14:06: Day-of-week Predicates (chan 3115512)
  • When business logic dictates that something only happens on Saturday, this snippet can help keep your code and tests legible. module DatePredicates Date::DAYNAMES.each_with_index do |day_name, i| define_method "#{day_name}?" do i == wday end end end   class Date include DatePredicates end Date.today.Tuesday? => true

  • 07/09/09--17:08: Run Safari 3.2.1 alongside Safari 4 (chan 3115512)
  • It’s important to be able to test your application across multiple versions of major browsers. Safari’s use of a system-wide Webkit makes this a little difficult, but fortunately enterprising developers have worked to package up a stand-alone version of Safari 3.2.1. Download Safari 3.2.1 Stand-Alone.

  • 09/02/09--14:17: Cookie Path Handling Inconsistencies (chan 3115512)
  • Cookies stored with a path option are treated somewhat differently in Internet Explorer than they are in many other browsers. The issues are especially prevalent in modern web applications with “clean” urls. For example, a cookie stored with a path of /movies/the-wizard-of-speed-and-time is not visible to Internet Explorer users visiting /movies/the-wizard-of-speed-and-time, but is visible to [...]

  • 01/21/10--09:00: If A Then B (chan 3115512)
  • In hacking on the gRaphaël code base, I came across a recurring pattern syntax pattern I hadn’t encountered in JavaScript before. Essentially, instead of using this very common conditional construct: if (a) b; The author uses: !a && b; Similarly, if (a) b; else c; Is written: !a && b; a && c; I was curious about the performance difference between the styles, and [...]

  • 01/21/10--11:00: JavaScript cast to Number (chan 3115512)
  • Another interesting technique I spotted in the gRaphaël code base is the use of a prefixed + used to cast a variable to a numeric type. var data = [ undefined, null, 1, 10.2, new Date() ]; for (var i = 0, len = data.length; i < len; i++) console.log('cast %o: %o', data[i], +data[i]); If you run [...]

  • 01/27/10--16:36: Subdomains in development using ghost (chan 3115512)
  • The Problem Using subdomains with Rails is kind of a pain. The only official support for subdomains is as asset hosts, as described in the AssetTagHelper documentation. Matthew Hollingworth’s subdomain_routes covers most of the gaps in dealing with subdomains in Rails, including; generating subdomain routes, scoping resources to subdomains, and exposing subdomain information to controllers. What I [...]

  • 02/18/10--21:33: Keep your production credentials encrypted, hassle-free (chan 3115512)
  • Previously, I demonstrated how to set up an encrypted store in Mac OS, but didn’t describe why you might want to do such a thing. Encrypt Using an encrypted store like this can help keep your company’s sensitive passwords safe should your computer be compromised. We use Capistrano to deploy to production servers, and in our deploy.rb cap [...]

  • 02/26/10--11:18: Ruby RegExp match variables really are local (chan 3115512)
  • While reading Yehuda Katz’ blog post concerning mental models about Ruby’s behavior, I was a bit rankled by his reference to implicit locals created by running regular expressions with match clauses. I was nearly certain that the dollar-sign prefix on the variables ensured the variables were global, but had to verify for myself. Surprisingly, I found that [...]

  • 12/08/10--18:54: Hash value mapping (chan 3115512)
  • Ever have to map all the keys of a Hash, or Hash-like Ruby object? For example, you have a Hash mapping keys to the binary contents of several files, and you want to present those file contents as Base64. Imagine we have a Hash that looks something like this: pictures_hash = { 'goblins' => PICTURE_OF_GOBLINS, [...]