Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup 5/13/2010

Alexander Murmann
Thursday, May 13, 2010

Interestings

Webtoolkit Base64 encoding is wrong

If you need to do Base64 encoding/decoding in JavaScript, you likely came across this link (as it’s the #1 Google hit for: “base64 enocde javascript”):

http://www.webtoolkit.info/javascript-base64.html

This code (for encode) works just fine as long as you’re only dealing with strings whose contents are plain ASCII test (no high bits set).

But this code does a UTF encode before the Base64 encode. Which means that any characters with the high-bit set will get expanded first and your Base64 encoding will be wrong. For example, if you build a SHA1 encoded string and then Base64 encode it, you’ll get a resultant string that’s longer than the expected 28 bytes.

Our solution was to keep Googling around until we found some JavaScript Base64 code that did not do any Unicode expansion. Here’s one that does the right thing – there are more, but are hard to find:

http://nerds-central.blogspot.com/2007/01/fast-scalable-javascript-and-vbscript.html

Factory Girl after_create

You might want to use factory_girl to create an object that includes another object. If both factory methods make use of the after_create callback the child’s after_create will be called before the parent’s. This behavior might seem unintuitive and you should keep this in mind working with factory_girl.

Ruby Mine running focused tests from inside context

It turns out that having shoulda anywhere in your project will break running focused tests from inside a context. This will also break ii you use a plugin that comes with shoulda.

Ruby Mine commit & push

Ruby Mine’s behavior when using commit together with the push option might not behave as expected. For us it merged a branch and truncated all changes that had occurred on that branch since the last update.

WebKit JS treats “export” as keyword

One of the many unused keywords in JavaScript is “export”. Firefox lets you use it since it’s de facto unused. However, using “export” in your JavaScript will break your code in WebKit-based browseres.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

Alexander Murmann

Alexander Murmann
San Francisco

Recent Posts

  • SF Standup 2012-02-14
  • Standup 05/26/2011
  • Resque Heroku Autoscaler Gem
Subscribe to Alexander's Feed

Author Topics

agile (9)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >