Tiago Scolari

bits for fun

Keeping track of your deploys with capistrano and git

2012-02-19 Code

I’ve created a simple capistrano task to keep track of my deploys. When I deploy to a server, it will create a git tag and push it to origin. This way I can keep track of each deploy revision.

after 'deploy:update_code', 'git:create_deploy_tag'

namespace :git
  task :create_deploy_tag do
    puts "[git] creating new deploy tag"
    tag_name = "deploy--#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}"
    `git tag -a '#{tag_name}' -m 'Deploy: #{Time.now}' origin/production && git push origin --tags`
   end
end

p.s: I use the production branch as my deploy branch. You can change it for master, or anything else.

Continue reading

Android: Camera and Image Gallery

2011-10-10 Code

Here is some simple steps to access the phone camera and image gallery. This will be a very simple app. There is only one view, it will hold 2 buttons for selecting the image (one from camera and another from the gallery) and a ImageView that will show the selected image. I’ll not talk about the layout here, what I did is ugly and looks like this:

Continue reading

Android Webapp in 3 Minutes

2011-09-19 Code

I’m going to use the rails application I created on the post How to Build a Mobile Rails 3.1 App to create a simple android app. You probably can do this in less than 3 minutes, I guess.

** UPDATE **

This guide is good to get you started, but I consider it deprecated. I think the end result gives a bad user experience, since it will won’t behave as an proper mobile app, and it won’t also behave as a webpage. Worst place ever.

Continue reading

JQuery-Mobile for Rails 3.1 Gem

2011-09-14 Code

I’ve created a very simple gem that includes the jquery mobile files to Rails’ assets pipeline. To install, just add to your Gemfile:

gem 'jquery_mobile_rails'

And require the javascript/css files in your manifests:

//= require jquery.mobile.min
*= require jquery.mobile.min

That’s it. No helpers, no methods, only the files in your application assets pipeline. For more information check the github repo.

Older posts Newer posts