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

Monthly Archives: June 2012

Ronan Dunlop

Jeff Ma’s new company tenXer makes velocity personal

Ronan Dunlop
Monday, June 11, 2012

Congrats to our friend Jeff Ma and his latest enterprise tenXer for being written up in the New York Times.

tenXer tracks activities from your Pivotal Tracker, GitHub, Phabricator, Google Calendar, and Gmail accounts and provides statistics about your performance. To put it in terms our users are more familiar with, it’s about visualizing your “life Velocity”. You can read more on the benefits of tenXer on the tour section of their site

Thanks Jeff and the gang at tenXer for choosing to integrate with Tracker right out of the gate. If like us at Tracker, you use most of the services tenXer connects to already, there is really no good reason not to get a tenXer account today.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Wiley Kestner

WWDC && More

Wiley Kestner
Monday, June 11, 2012

Helps

  • Standup is back in the Lounge today

Hang on folks, we’re iterating again…

  • Recommendations when writing a migration

This is in regards to a migration which involves a large amount of models.

One option is to clone the models you care about (into a different directory).

Another option is to do the schema change and the data migration as a rake task that is unit testable.

It depends whether this is a one-time event or if it’s a boundary you’re going to cross back-and-forth.

Interestings

  • JSON Deep Clone in 1 line

def JSON.deep(object)
JSON.parse(object.to_json)
end

Events

  • Yoga @ 6p – all welcome
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Wiley Kestner

WWDC && More

Wiley Kestner
Monday, June 11, 2012

Helps

  • Standup is back in the Lounge today

Hang on folks, we’re iterating again…

  • Recommendations when writing a migration

This is in regards to a migration which involves a large amount of models.

One option is to clone the models you care about (into a different directory).

Another option is to do the schema change and the data migration as a rake task that is unit testable.

It depends whether this is a one-time event or if it’s a boundary you’re going to cross back-and-forth.

Interestings

  • JSON Deep Clone in 1 line

def JSON.deep(object)
JSON.parse(object.to_json)
end

Events

  • Yoga @ 6p – all welcome
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Mark Rushakoff

We’re finally getting destroy! in Rails 4

Mark Rushakoff
Friday, June 8, 2012

Unlike create!, save!, and friends, the destroy! method didn’t exist in Rails 3.
It took me a while to get used to destroy instead of destroy! from the Rails console and from test code, but Rails 4 will provide destroy!, which is different from destroy in the following ways:

  • Instead of returning false on failure, it will raise ActiveRecord::RecordNotDestroyed
  • If you have a before_destroy callback that returns false, it will still raise ActiveRecord::RecordNotDestroyed

There’s going to be a lot less cycles of “write a test that calls destroy!, see a NoMethodError, change destroy! to destroy, and re-run the test” once Rails 4 is released. I know I’ve lost a few minutes of my life doing that :)

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joelle Gernez

[Standup][SF] 06/08/12: coccyx: kok-siks; plural: coccyges

Joelle Gernez
Friday, June 8, 2012

Helps

  • CI request spec video gem?

suggestion: use Capybara error call back and a screen shot utility.

Interestings

  • Forgotten Feature: Rails redirect_to and flash

You can set parameters in the flash scope when redirecting:

redirect_to pants_path, :notice => “Successfully put on pants!”

redirect_to pants_path, :alert => “Pants are alight! Douse them forthwith!”

redirect_to pants_path, :flash => { :error => “What pants?” }

  • should_receive(”some_string”) gives a helpful ‘stack too deep’ error

Don’t accidentally pass should_receive a method name as a string instead of a symbol. You’ll get a lovely ‘SystemStackError: stack level too deep’ error.

  • coccyx: it plugs up backbone

https://github.com/onsi/coccyx

coccyx is a tiny little addition to backbone that I cooked up that addresses finding and fixing memory leaks by solving two problems:

1) you can pass constructorName in as a parameter when defining your Backbone class to get a custom constructor name printed out (instead of “child”) in console.log and in Chrome’s heap analyzer.

2) you can call view.tearDown() to automatically unbind any callbacks attached to view.model, view.collection, and delegateEvents. You can also add a custom beforeTearDown handler to clean up any other references you might be aware of.

The best part is: if you registerSubView() as you add subviews then calls to tearDown on a root node will walk the subview hierarchy and clean the subviews up too.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Dirk Kelly

Standup 06/08/2012: Awkwardly Unprofessional

Dirk Kelly
Friday, June 8, 2012

Interesting Things

  • ObjectSpace is a class in Ruby which stores information about all instantiated objects. Great stuff for debugging, but don’t go using it in your code.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Kris Hicks

exec

Kris Hicks
Thursday, June 7, 2012

(Update #1 below)

Say you’re going to do an interactive rebase where you’re going to be squashing commits or reordering them. During this process you may want Git to execute a command after applying certain items of the todo list. An example of this would be when you want to run rake or similar to ensure a newly-squashed commit is still green.

You can do this by adding a task to the todo list, exec, followed by the command you’d like Git to run at that point in the rebase. If the command you specify should return a non-zero exit code, Git will pause the rebase and allow you to sort it out, in the same way that it pauses when a conflict arises while applying the todo list during any other rebase.

Here’s an example of the above situation, where two commits are going to be squashed, and I want Git to run rake after it does the squash.

Pre-edits, this would look like:

pick dad8d12 Commit #1
pick f613ac1 Commit #2
pick 58822ee Commit #3

Post-edits, this would look like:

pick dad8d12 Commit #1
f f613ac1 Commit #2
x rake
pick 58822ee Commit #3

What happens here is Git will fixup Commit #2 into Commit #1, creating a new commit, then run rake. If rake returns a zero exit code, Git applies Commit #3 and completes the rebase. If rake had returned a non-zero exit code, Git would have paused the rebase operation at that point, allowing any necessary changes to be made to the HEAD commit, which is the squashed #1/#2.

I typically do this separate from doing an initial rebase, where I rebased and made a change to Commit #1 and had to resolve conflicts throughout the rest of the commits. This way I can keep my head straight while doing the rebase, then fix anything I missed as a second operation.

Update #1: As of Git 1.7.12 you can pass -x <cmd> to git rebase -i to have Git run the exec command after every commit in the resulting history: git rebase -i <treeish> -x <cmd>.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Phan Le

06/07/12: It’s quiet when Heroku is down

Phan Le
Thursday, June 7, 2012

Helps

  • Support D3 on IE (http://d3js.org/)

Someone suggests using Google Frame.

Interestings

  • perseverate

per·sev·er·ate/pərˈsevəˌrāt/

Verb: Repeat or prolong an action, thought, or utterance after the stimulus that prompted it has ceased.

  • Lo-Dash: Drop-in Underscore.js replacement

“Underscore.js + performance improvements, bug fixes, and additional features.”

http://lodash.com

  • Font-Awesome: Like Bootstrap’s icons but better

  • Icon parity with Bootstrap 2.0.3

  • Many other icons
  • Compatible with, but does not require Bootstrap
  • Free for commercial use (CC BY 3.0)
  • http://fortawesome.github.com/Font-Awesome/

  • Long environment variables are BAD on Heroku

Just don’t use it, the application won’t start. And also make sure you have quotes surrounding strings with equal signs in between.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Brent Wheeldon

[Standup][NYC] 6/7/2012

Brent Wheeldon
Thursday, June 7, 2012

Interesting

  • A pivot needed to set some data in the flash for the setup of a controller test and discovered the optional 3rd and 4th parameters for ActionController::TestCase::Behavior’s get, put, post, etc. methods which allow the setting of session and flash respectively.
  • Yesterday was IPv6 day. On a related note, some hosting providers are starting to run low on IPv4 addresses and are encouraging people to move to IPv6 where they can.

Events

  • Tonight at 6.30 there is a panel in the event space called Startups: Their Journey to Success
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joelle Gernez

[Standup][SF] 06/06/12: Remember…

Joelle Gernez
Wednesday, June 6, 2012

Interestings

  • Nested route parameters are remembered

If you’re in a controller action and you get there via a nested route, any path helpers you call automagically get the ID of the resource you’re nested under. The route helpers reverse-merge in the parameters of the request.

This means if you have these routes:

resources :magazines do
resources :ads
end

and you’re in an action in the ads controller, nested under magazine 5, you can do this:

edit_magazine_ad_path

without passing in a magazine object. It will pull magazine_id 5 out of the request parameters.

  • (1..100).grep 38..44

results in

[38, 39, 40, 41, 42, 43, 44]

As per ruby enumerable docs.

This is because grep uses threequel, which on a range is defined as inclusion. Answer courtesy of Giles Bowkett

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (779)
  • rails (113)
  • testing (87)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (54)
  • techtalk (44)
  • rspec (38)
  • ironblogger (31)
  • productivity (30)
  • activerecord (29)
  • gogaruco (29)
  • git (28)
  • nyc (27)
  • rubymine (26)
  • bloggerdome (22)
  • mobile (22)
  • process (20)
  • pivotal tracker (20)
  • cucumber (20)
  • jasmine (19)
  • design (18)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • tracker ecosystem (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • bdd (14)
  • gem (13)
  • tdd (13)
  • selenium (12)
  • css (12)
  • goruco (12)
  • bundler (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • api (10)
Subscribe to Community Feed
  1. ←
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. →
  • 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 >