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
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Monthly Archives: June 2012

Matthew Parker

[Standup][NY] 06/29/12: Fireworks!

Matthew Parker
Friday, June 29, 2012

Helps

Should attributes changed during after_save/after_create callbacks be marked as dirty?

We were surprised to learn that attributes changed in after_save/after_create callbacks were not marked as dirty.
Weigh in here.

Interestings

ActiveRecord#Migration.add_column with default

In Rails 3.0, does not use the single line Postrges ALTER TABLE foo ADD COLUMN bar TEXT DEFAULT wibble, which will back-populate NULL columns. If you set null: false, it will use a non-optimal approach to back-populate NULL rows.

Comma — easy CSV generation

Comma is a CSV generation extension for Ruby objects, that lets you define a CSV output format via a DSL —

http://github.com/crafterm/comma

Chrome on iOS

Available on iPad and iPhone.

Events

Fireworks on Saturday!

Pyromaniacs get ready: fireworks Saturday through Wednesday in NYC.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Vinicius Baggio Fuentes

[Standup][SF] – Remote CI

Vinicius Baggio Fuentes
Friday, June 29, 2012

Interestings

  • Watching your browser specs locally from CI

Assuming you’re using the headless gem in CI and have browser specs (Jasmine, Selenium) and want to watch them locally, ssh -X is your best friend. It will have Firefox draw its pixels on your Mac screen. Slow, but powerful.

To make that work you need a few steps:

1) Be sure to launch X11, go to Preferences (⌘+,) > Security > Check the “Allow connections from network clients” checkbox
2) Restart X11
3) Be sure that X11Forwarding is set to “yes” in the server (after changing it, restart SSHD, killing sshd works)

To see if it is working, check the $DISPLAY env variable after connected, it should be set.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Vinicius Baggio Fuentes

06/28/12: It’s Thursday!

Vinicius Baggio Fuentes
Thursday, June 28, 2012

Interestings

  • Rubymine broken Cmd-E

Seems like the dialog that shows recent files is very broken. If you are experiencing the same problem: go here to +1 the issue http://youtrack.jetbrains.com/issue/RUBY-11460 .

  • heroku pgbackup -> pgrestore does not do what you think it should do.

Confirmed by Heroku:

  1. Make a backup of production, get a url
  2. Restore the backup (’url’) into staging
  3. Deploy next release candidate, run migrations, some things fail, but table “x” is created
  4. Fix the code, commit, etc.
  5. Restore the backup (’url’) into staging (recreate url if necessary)
  6. Deploy the next release candidate, run migrations, migrations fail because table “x” already exists
  7. Scratch head

The fix (also from Heroku):

  • Run a heroku pg:reset on the target db before importing to force clean the db.
  • Considering database provisioning is nearly instantaneous for most users, restoring into a fresh database is best practice, and we will work towards making that the default option in the future.

  • Cloud9 IDE

http://c9.io/site/features/

IDE in the cloud where you get your local workspace over SSH/FTP. Explicitly mentions pair programming throughout the site.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Matthew Parker

[Standup][NY] STI Rake Gotcha

Matthew Parker
Thursday, June 28, 2012

Interestings

http://avatars.io/

Interested hosted avatar service for getting user avatars from Twitter, Facebook, Intragram, Gravator or Custom.

STI rake gotcha

StiBaseModel.some_scope

  • works as expected in rails console (dev)
  • works as expected in tests
  • exhibits unexpected behavior in a rake task (in development mode)

It’s caused by an autoloading gotcha in dev mode with STI models, which oddly isn’t reproducible in rails console in dev mode (on Rails 3.2.5). The children of the STI model aren’t autoloaded in the rake task in dev mode, so the “type = ?” clause in the queries don’t include the subclasses of the STI base.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Ronan Dunlop

Powerinbox – Putting the "POW!" back into your inbox

Ronan Dunlop
Wednesday, June 27, 2012

Email is an antiquated concept that is an unmitigated productivity killer. Personally I have a suspicion that it’s actually Skynet 1.0. That said, it ain’t going away tomorrow or next month and or even by the end of the decade. So what is a human to do.

In comes Powerinbox – a company that has a “the glass is half full” perspective on the issue. What they do is bring apps to your email, just like the iPhone brought apps to your phone. For starters, you can view your facebook, twitter and linkedin feeds right from your email account.

Powerinbox is free and integrates with Gmail, Yahoo mail, hotmail and Outlook and more relevantly, they play nice with us, PIVOTAL TRACKER! To learn how check out their really informative blog post.

In a nutshell – if you’re reading this you are the resistance and very likely a Tracker user with an email account and a host of social media connections – so do yourself a solid and checkout Powerinbox.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Vinicius Baggio Fuentes

[Standup][SF] 06/27/12: JRuby Forks

Vinicius Baggio Fuentes
Wednesday, June 27, 2012

Helps

  • fork in jruby

we’d like to use a gem (rescue-pool) that uses ‘fork’ in jruby. Right now the gem raises when fork is unavailable in jruby. Is there a pattern for replacing a ruby fork with a java Thread?

  • Suggestions were made to use Thread.fork instead.

Interestings

  • Javascript and window.matchMedia

For implementing responsive layout, browsers support the use of event handlers that are tied to state changes of media queries. It means that you can have JavaScript events triggered in a manner similar to how CSS rule changes are implemented.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joseph Palermo

06/26/12: Headless is fine, double headless is trouble

Joseph Palermo
Tuesday, June 26, 2012

Interestings

  • Don’t Lose Your Head (twice)

Using rake ci:headless[...] AND having an around filter in your spec_helper to run your capybara JS specs headlessly is not a winning combo. Pick one.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joanne Webb

The Viewer Role: Giving read-only access to your projects

Joanne Webb
Tuesday, June 26, 2012

There are times when you might want to invite someone to your project but only give them read-only privileges in it. You might also want to change an existing project member’s access so they can see your project but not add stories or make changes to it. Also, read-only project members don’t count against plan collaborator limits for an account.

In such situations, the Viewer role in Tracker is just what you need.

Only a project owner can manage roles and that’s done on the project Members page. There are a few ways to get there, for instance:

Mouse over the project name on the left side of your Dashboard and click Members

Alt text

or
View the stories in your project and select Add/Remove Members in the PROJECT drop-down

Once you’re there…

To change a Member’s role to Viewer:

At the project Members page:

  1. Select Viewer from the Role drop-down to the right of the email address for each person you wish to change the role for.

The change is immediate and will apply to this project only. So if you have more than one project in your account and want to reduce the number of collaborators in that account, please repeat the above for the same person in all projects in the account.

To add someone to a project as a Viewer:

At the project Members page:

  1. Enter their name or email in the Add Member field, then select Viewer in the drop-down directly to the right of the field (the default is Member)

  1. Click Add and fill in any further information you are prompted for, etc.

or

  1. Click the “Add members from list” button.
  2. Select the Invite checkbox for each person you wish to add.
  3. Select Viewer from the Role drop-down to the right of the email address for each person you are inviting.
  4. Scroll down, if necessary, and click the “INVITE CHECKED” button.

Feedback

We hope this helps you get more out of Tracker. As always, we value feedback, so we’d love to hear from you in the comments here or on Facebook, Twitter, or by email to tracker@pivotallabs.com.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Matthew Parker

[Standup][NY] Free WIFI in the subway

Matthew Parker
Tuesday, June 26, 2012

Interestings

Free Boingo wifi in the subway

Free wifi all over the city from Boingo, including subway stations.

http://techcrunch.com/2012/06/25/google-offers-and-boingo-bring-free-wifi-to-manhattan-this-summer/

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Kris Hicks

rewinding git commit –amend

Kris Hicks
Monday, June 25, 2012

It may come to pass that you will amend HEAD with changes that were meant to go on a commit earlier than HEAD via git commit --amend. In this case, you’ll want to rewind that operation you just did, and apply it to the correct commit. With simple changes you may find git reset -p handy. For times when the changes are far too large and intertwined to the commit, you will want to refer to git reflog for help.

The reflog records when the tip of a branch is updated. The tip is updated any time you create a new commit, amend a commit, reset a commit, switch branches, etc. Basically, any time HEAD changes, you will get a reflog entry. The reflog therefore is a great tool for understanding how the repository came to be in a particular state.

git reflog -2 will give you the last two operations that Git performed. In this case, it will look something like:

8751261 HEAD@{0}: commit (amend): Something something something commit message
9d3a192 HEAD@{1}: reset: moving to HEAD~1

git commit --amend is kind of shorthand for (given changes have been made, and are either in the index or in the working directory):

git stash
git reset HEAD~1
git stash pop
git add .
git commit

Or, in English:

  • Save the changes that you want to apply to the HEAD commit off in the stash
  • Remove the HEAD commit and put its contents in the index
  • Apply the stashed changes to the working directory, adding them to the changes from the commit that was reset
  • Make a new commit.

Thus, the last two operations in the reflog are reset and commit.

So, what can we do with this? Well, 9d3a192 was HEAD before the amend (specifically, before the reset) happened. 8751261 was the commit that resulted at the end of the amend process. git diff 8751261..9d3a192 will show you what changes were applied as part of the amend.

From here, you can use git apply to apply the difference from before the amend to after the amend to your working tree via git diff:

git diff 8751261..9d3a192 | git apply -
  • Note: The hyphen in git apply - causes git apply to take stdin as input.
  • Extra Note: The arguments here are given in reverse order, with the later commit happening first to show the reverse of the amend. It’s the same as doing git diff 9d3a192..8751261 -R, which reverses the diff output. Additionally, the -R argument may be applied to git apply instead of git diff to achieve the same effect.

Now we can do another amend to put the commit back to where it was before we did the previous amend:

git commit -a --amend -CHEAD

And then, by reversing the order of the SHAs to git diff, get the changes we want to apply to the correct commit back:

git diff 9d3a192..8751261 | git apply -

And commit as necessary, this time using –fixup to indicate the correct commit (in this example, 1234567):

git commit -a --fixup 1234567

Then you can rebase at a later time (or now) to do the ‘amend’ you had originally intended:

git rebase --i --autosquash 1234567~1

So don’t fret when you do an accidental amend. It’s just a couple commands away from being unwound and applied to the correct commit.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (783)
  • rails (117)
  • testing (90)
  • ruby (86)
  • ruby on rails (71)
  • jobs (62)
  • javascript (59)
  • techtalk (44)
  • ironblogger (42)
  • rspec (39)
  • bloggerdome (34)
  • productivity (34)
  • activerecord (30)
  • rubymine (30)
  • git (29)
  • gogaruco (29)
  • nyc (27)
  • design (24)
  • mobile (23)
  • pivotal tracker (22)
  • process (21)
  • cucumber (21)
  • jasmine (19)
  • ios (18)
  • tracker ecosystem (17)
  • webos (17)
  • objective-c (17)
  • fun (16)
  • android (16)
  • palm (16)
  • ci (16)
  • "soft" ware (16)
  • bdd (15)
  • tdd (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • css (14)
  • gem (13)
  • mouse-free development (12)
  • selenium (12)
  • goruco (12)
  • bundler (12)
  • api (12)
  • keyboard (11)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
Subscribe to Community Feed
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • 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 >