Permalink
Browse files

3 new posts that were pending

  • Loading branch information...
1 parent 8e7aa45 commit 67a8e1c257df6865163cfda1aa1c9a7ab46ffbd4 @luisalima committed Dec 19, 2012
@@ -0,0 +1,31 @@
+---
+layout: post
+title: "Analytics js & a mash of interesting rails stuff"
+date: 2012-12-14 13:34
+comments: true
+categories: analytics js rails webdev
+---
+
+Analytics.js
+------------
+
+I don't know whether this library is very common, but it definitely shows a lot of promise:
+
+[Segmentio's Analytics.js](http://segmentio.github.com/analytics.js/)
+
+It provides provider-agnostic hooks to route to analytics services. They also have a hosted version where the analytics services can be changed without touching the code. Looks really clean and neat.
+
+Nice video: to_proc
+-------------------
+
+[This video by CooperPress](http://www.youtube.com/watch?v=aISNtCAZlMg) explains in a very clear fashion how to use the "to_proc" feature of Ruby (and understand some weird code you might come across). It is also well worth it to subscribe to [their other videos](http://www.youtube.com/user/CooperPress?feature=watch).
+
+Faster Rails partial rendering and caching
+------------------------------------------
+
+I sure will try out [this gem (multi_fetch_fragments)](http://ninjasandrobots.com/rails-faster-partial-rendering-and-caching/) to optimize Rails when I get to that point of my work...
+
+Indexes in Rails databases
+--------------------------
+
+[Extremely good article by Tom Ward on using indexes in rails associations](http://tomafro.net/2009/08/using-indexes-in-rails-index-your-associations). An excellent guide to determine what indexes your app should include (no more, no less).
@@ -0,0 +1,48 @@
+---
+layout: post
+title: "How I test - Part I: Environment"
+date: 2012-12-14 11:43
+comments: true
+categories: rails, testing, TDD
+---
+
+Not that I am an authority in testing... this is just a compilation of the so-called "best practices" that I've been seeing around, as well as some extra tips from my (very limited) experience. I'd love to hear the feedback from more experienced people... I'm going to do several of these as I go along.
+
+Gems I use
+----------
+
+I test using [rspec](http://rspec.info) and [shoulda](https://github.com/thoughtbot/shoulda), which dramatically reduces the size of the tests. But beware -- rspec is a DSL, and I think that I only got a bit more intuition on what I was exactly testing after doing some tests in Test::Unit. I also use [FactoryGirl](https://github.com/thoughtbot/factory_girl) for setting up the test data, instead of fixtures. Last but not least, the [simplecov](https://github.com/colszowka/simplecov) gem is amazing, and although you shouldn't rely on it to determine when to stop testing, it really is good to get a (very precise) sense of what's covered and what's not in their beautiful html reports.
+
+General tips
+------------
+
+When all your tests are red for no apparent reason, it's because you were messing around with the db and then forgot to do
+
+<pre><code>rake db:test:clone</code></pre>
+
+Yup, the reason I am mentioning it here even though it seems completely obvious is because I am distracted and do that a lot... :-)
+
+Tips for running guard/spork in vagrant
+---------------------------------------
+
+I use vagrant to keep my environment all neatly in one place. However, there are downsides. When running guard inside the guest OS, use
+<pre><code>bundle exec guard -p</code></pre>
+Otherwise, guard won't detect changes in the guest filesystem.
+
+FactoryGirl tips
+----------------
+
+You can keep all factories in one file, for me that is more intuitive (and also, I don't have to keep opening files while I'm testing, it's all in one place.)
+
+To try FactoryGirl methods in the console, run:
+<pre><code>FactoryGirl.find_definitions</code></pre>
+
+At least in my case, I would get a [factory not registered](http://stackoverflow.com/questions/8409787/factorygirl-factory-not-registered-user-argumenterror
+) error when I didn't do that.
+
+Better Errors
+-------------
+
+Not exactly related to testing, but this gem has been a life changer! When there is an error, the standard error page gets replaced by a much better and useful error page, which has a full trace, the local and instance variables that are set at the time, and a terminal that you can use to inspect and make changes to the variables in the models and controllers in real time (or code whatever you want). I know I already mentioned it in another post, but I can't stress enough how cool this gem is!
+
+In the next posts, I'll give an overview of how I test the models and controllers, which I only started testing this week!
@@ -0,0 +1,16 @@
+---
+layout: post
+title: "Inspiring TED talk"
+date: 2012-12-18 11:06
+comments: true
+categories: ted talks business inspiring
+---
+For anyone who works in business (especially startups), this is most probably (or most definitely) the most important TED talk that you'll ever get to watch. Or the most important talk/piece of advice that you'll ever get, I believe.
+
+[How great leaders inspire action](http://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action.html)
+
+The fact is that this is what attracts me (and many people, probably) to startups. It's just easier to find this sharing of common beliefs -- and if it's not, it's the wrong startup.
+
+**People don't buy what you do, they buy why you do it.**
+
+People buy what you believe in. Somehow this makes me believe in mankind a bit more :-)

0 comments on commit 67a8e1c

Please sign in to comment.