Fetch rss feeds in Rails 4

Posted by LessCode on March 09, 2011

This simple article will show you how to fetch rss feeds in your rails application.

Run

gem install feed-normalizer

Just add this in your controller

require 'rubygems'
require 'feed-normalizer'
require 'open-uri'
def fetch
	@result = []
	File.open('public/feeds.txt', 'r').each_line { |f|
	  feed = FeedNormalizer::FeedNormalizer.parse open(f.strip)
  	  @result.push(*feed.entries)
	}
end

And in the view ( fetch.html.erb ) add this code

<% @result.each do |item| %>

<%= item.title %>

<%= item.content %> <% end %>

Create a file in public directory
feeds.txt

add some rss feeds in the file

http://feeds.feedburner.com/lesscodeismore

http://feeds.feedburner.com/37signals/beMH

and your are done..

, , , , , , (Intressant)





Interview with Santiago Pastorino

Posted by LessCode on March 04, 2011

Please tell us a bit about yourself and your background.
Santiago Pastorino
I’m Santiago Pastorino from Montevideo, Uruguay. I’m a programmer with
a Computer Science degree who after finishing my university studies
founded WyeWorks with José Ignacio Costa.
A company which does Ruby on Rails consultancy and development and
base our business on OSS.

Why did you choose Ruby?

I got bored of doing Java to the point I thought that I no longer liked programming but when I found Ruby I realize that it was just that I didn’t want to do Java because it wasn’t fun. Also I think Ruby is the most human friendly programming language I have ever used, it increases development speed, and it has an amazing community.

Why is Ruby a good language to learn?

The syntax is great, very clean, so it’s very easy to read.
It’s designed for humans happiness.

How should I proceed to learn Ruby?

I think that depends on each person, some suggestions could be read “The Ruby Programming Language” or “Programming Ruby” (Pickaxe).
And of course coding on it a lot.

When did you start working on Rails? What was the motivation?

About two years ago. The motivation was the development speed, the aesthetics and style of the code itself and the productivity you have. It lets you focus on the real problems and I really like the ‘Convention over configuration’ approach.

How would you briefly describe Rails from your perspective to new users?
Why should they consider it?

I guess for the same reasons of the previous question :) .

What operating system do you prefer?

OS X for my desktop and Linux for the servers.

What is your development environment look like? (Text Editor, Web
browser, etc.)

iTerm, vim + janus + some tweaks my partner José did.
Firefox as a web browser.
Campfire to chat with my colleagues.

Do you have a blog, website?

My website is my company website, WyeWorks
My blog is my company blog, WyeWorks Blog we owe a little more love to the blog, it’s been a while since the last post.
Our goal is to start writing interesting articles about Rails again.

What do you do in your free time?
I like to play soccer, travel, read books, watch movies, listening to music,
nothing special, just the regular stuff.

What are your future plans?

Keep boosting WyeWorks, start our own SaaS products, contribute even more to OSS, doing useful pieces of software that people love to use and helping even more on Rails completing new useful features.

, , , , , , , , (Intressant)





Interview with David Heinemeier Hansson

Posted by LessCode on March 01, 2011

Please tell us a bit about yourself and your background.
David Heinemeier Hansson
My name is David Heinemeier Hansson. I’m 31, originally from Copenhagen, Denmark, but now live in the US. I’m the creator of Ruby on Rails and a partner at 37signals.

Why did you choose Ruby?

The language fits my brain like a glove. It’s beautiful, it’s poetic, it’s succinct. Everything that PHP and Java never was and can’t be. Those were the two former platforms I had been dealing with.

Why is Ruby a good language to learn?

It cuts out all the bullshit and makes it very easy to go from thought to code.
No boilerplate nonsense, no pain, just programs rising from your imagination.

How should I proceed to learn Ruby?

I originally learned Ruby from Dave Thomas’ Programming Ruby (also known as the Pickaxe book). It’s a great introduction to Ruby. I’d recommend it.

When did you start working on Rails? What was the motivation?

I started in 2003. I was developing Basecamp for 37signals and I had decided to use Ruby. At that time Ruby didn’t really have a lot of great web frameworks, so I had to roll my own. I’m glad I did. I learned a ton and the product became Rails.

How would you briefly describe Rails from your perspective to new users? Why should they consider it?

Rails allows you to easily use Ruby to build web applications. Ruby is really the star here. But a great language isn’t enough if you actually want to use it for something, you need supporting frameworks and libraries for your use case. Rails provides that.

What operating system do you prefer?

OS X.

What is your development environment look like? (Text Editor, Web browser, etc.)

TextMate, Safari, Terminal.

Do you have a blog, website?

http://www.loudthinking.com

What do you do in your free time?

http://youtube.com/dhhracing

What are your future plans?

To stick with what I’m doing well.

, , , , , , , , , (Intressant)





Interview with Fabio Akita

Posted by LessCode on February 26, 2011

Please tell us a bit about yourself and your background.

Fabio Akita
My name is Fabio Akita, also known as “Akita On Rails”. I am a Brazilian web developer and project manager working for Gonow Tecnologia, a Brazilian solutions provider. I also try to maintain my activities as a Ruby on Rails evangelist, presenting talks and organizing RubyConf Brazil, the largest Ruby conference in Latin America. You can follow me on Twitter (@AkitaOnRails) and if you understand Brazilian Portuguese you’re welcome to my blog (www.akitaonrails.com).

Why did you choose Ruby?

I am a programmer since the early 90′s so I worked with many different platforms including the mainstream Java, PHP and .NET. The first time I heard about Ruby on Rails (pre-1.0) was almost a “revelation”. I was already tired of the tedious overhead the Java frameworks of the time presented and the lack of cohesion in the PHP platform. So Rails led me to Ruby and when I realized that Rails is nothing but an “extension” to Ruby, that was so elegant I decided to dig deeper. And I enjoyed every step of the way.

Why is Ruby a good language to learn?

I won’t say Ruby is the best language to learn. If you’re a programmer, Ruby is as good a language to learn as any other. All languages are Turing complete. All languages are inspired by its predecessors. So learning a new language usually adds up to the knowledge you already possess and improves your current skills. Ruby has a delightful syntax that is a joy to work with, it has elegant constructs such as blocks, elegant choices such as having optional parentheses, and very useful features such as having open classes and trying to make almost everything be an object. It spices up object oriented programming with functional aspects that make it very dynamic and invites for different patterns of organizing your code. So you will only gain a lot by learning Ruby.

How should I proceed to learn Ruby?

There is no recipe to learn. I advocate that reading books is the slowest way to learn anything. They are necessary, but you will be able to bootstrap the process faster by just cloning a Github project and trying to make sense of the code. Choose useful projects such as Radiant, Refinery, Webiva, Casein, and many others. Try to make them run. Try to tweak the code and see how it behaves. Once you get the “feel” of it, you can start to dive deeper. Read the Rails Guides, have the Ruby Programming (PickAxe) book at hand for quick reference. Watch Ryan Bates’ video podcasts. Google around for tutorial blog posts. Learning is a discovery process, not a fixed procedure. You have to understand your own pace and speed. Just be aware that your first few projects will probably be the worst code you will write, so be ready to throw stuff away and start over, that’s how you learn.

When did you start working on Rails? What was the motivation?

I started around late 2005 when I was working as a senior Java and SAP developer. I read a lot (skimming through hundreds of blog posts everyday for more than a decade) and all of a sudden my radar picked several mentions to some “Ruby on Rails”. It was just too much to ignore so I started to research it. The more I read about it, the more surprised I was. Having being involved in the tech world since the mid-80′s, it is not easy to surprise me. I don’t like to not know stuff, it doesn’t matter if I will be able to make money out of it or not, but the fact that I was ignorant of what Ruby was compelled me to look carefully.

How would you briefly describe Rails from your perspective to new users? Why should they consider it?

For newcomers, Ruby on Rails and its satellite projects from the ecosystem deliver a very compelling set of tools and industry strength best practices that are always evolving. Rails, by itself, is not as compelling because we already have several interesting competing frameworks in other platforms. But it is the combination of a strong community, evolving techniques and best practices, several useful tools that make it worthy. The Ruby ecosystem is what makes it hard to “copy” Rails. You can copy its features, but you can’t easily recreate the same dynamic ecosystem around it.

What operating system do you prefer?

As my development machine, I prefer my Macbook Pro with OS X. For production servers usually Debian or CentOS.

What is your development environment look like? (Text Editor, Web browser, etc.)

I’ve been evangelizing the usage of Vim (https://github.com/akitaonrails/vimfiles) because it is a very competent and light text editor and it has the advantage of working in multiple platforms (Mac, Linux, Windows). I use RVM to switch between multiple Rubies. For my Mac I use Homebrew to install open source software. Because I do lots of presentations I use Keynote. For screencast recording I like ScreenFlow and iMovie for simple editing. I use Reeder for my RSS management and Echofon as a Twitter client. I prefer Safari as my main browser, with Flash removed. If I need Flash I fire up Chrome. And for Firebug I load Firefox. Because now I am required to write business proposals and exchange business documents, unfortunately, I have to use Microsoft Office 2011.

Do you have a blog, website?

Yes, please check out www.akitaonrails.com if you speak Brazilian Portuguese.

What do you do in your free time?

I am workaholic, so I use my free time to study and read more. Not only about technology but also about philosophy, science, psychology, economy and other subjects that can add to my skills. On the occasional “free” time, I like to watch movies and hang out with friends.

What are your future plans?

I don’t have any fixed future plans, right now I am only trying to learn more and get more experience, not only in technical skills but in business capabilities. I try to keep myself open for opportunities and new endeavors.

, , , , , , , (Intressant)





Interview with Jamis Buck

Posted by LessCode on February 23, 2011

Please tell us a bit about yourself and your background.
Jamis Buck
I’ve been programming since I was in high school, starting with GW-Basic and progressing through TurboPascal, C/C++, Java, Python, and eventually discovering Ruby around 2001 or 2002. I worked for about five years at BYU, until I met David at the 2004 RubyConf. A few months later I found myself happily employed at 37signals, where I’ve been ever since!

Why did you choose Ruby?

Just before finding Ruby, I had been playing with Python. I liked a lot of things about it, but eventually grew tired of the significant whitespace. I went searching again, and found Ruby. Everything about it clicked for me: the blocks, the ubiquitous objects, everything.

Why is Ruby a good language to learn?

It might not actually BE a good language for everyone. It was for me, because there was very little mismatch between Ruby’s syntax, and how I thought about problems. I’ve been teaching Ruby to my son now, too, and it’s been interesting to see where match is not so seamless for him as it was for me. It’s still a great language for him to be learning, but among other things, the auto-coercion of values (both when it happens, and when it doesn’t) is surprising to him.

How should I proceed to learn Ruby?

Build something! I actually wrote a series of blog posts recently where I suggested implementing maze algorithms as a way to learn a language, and I really think that’s a great approach (if you’ve already got one or two programming languages under your belt). If you’ve got a specific project in mind already, though, that’s going to be even better. Books and websites will only take you so far; to
really become proficient, you need to apply what you’re learning in a “real” environment.

When did you start working on Rails? What was the motivation?

I first started working with Rails in the fall of 2004, after meeting DHH at RubyConf. He and Jason hired me on a consulting basis to work on some features for Basecamp, and that was really my first introduction to Rails. A few months later they hired me full-time, and I got to work with this stuff every day, day-in and day-out!

How would you briefly describe Rails from your perspective to new users?
Why should they consider it?

Rails makes the common case easy, and the uncommon case possible. More than that, though, it makes the common case “brainless”, meaning that you don’t even have to think about it. The common case is the default, and works by default. While this isn’t unique anymore, back in the day Rails really blew people’s minds, because they were used to the monolithic, XML-configured frameworks in Javaland and elsewhere that required you to configure every little thing, even (and maybe
especially) the things that were the same between 99% of your projects. A framework that did all that for you seemed too good to be true. :)

Other frameworks have adopted the “convention over configuration” idea now, but Rails still leads the pack, largely because of its Ruby underpinnings. Ruby’s awesome metaprogramming features make it
especially well-suited to applications like this.

What operating system do you prefer?

I’m a Mac guy, 100%. I was heavily into linux until I joined 37signals, and they introduced me to Mac OS. I haven’t looked back. :)

What is your development environment look like? (Text Editor, Web browser, etc.)

I use MacVim for writing code, and the latest stable version of Chrome as my browser. I use Terminal.app for command-line access, and I generally have two or three of them open (in tabs). I use Xcode when I do iOS development, but only for the build and debugging features; I still use Vim to write the code. Rake, of course, is indispensable. I use iChat for IM (but I don’t particularly like it; iChat is what we use at 37signals), and we use Campfire to communicate as a team.

Do you have a blog, website?

http://weblog.jamisbuck.org. It tends to be technically-focused, but beyond that is generally just about whatever I happen to find interesting, or whatever I happen to be working on at the moment.

What do you do in your free time?

I’ve been learning the guitar, using http://www.justinguitar.com as a lesson guide. I also enjoy reading science fiction and fantasy, woodcarving, playing with string figures (http://www.ekawada.com), and tinkering with software. :)

What are your future plans?

I’m really not sure. :) I take things a day at a time, and see where they take me.

Something you want to add?

Nothing, really. Thanks for the interview!

, , , , , , , , , , (Intressant)





Interview with Michael Hartl

Posted by LessCode on February 20, 2011

Please tell us a bit about yourself and your background.

Michael Hartl
I’m a programmer, educator, and entrepreneur. Recently, I’ve been focused on making educational products and selling them online; my flagship product is a Ruby on Rails tutorial called (wait for it) Ruby on Rails Tutorial. I’ve been doing web development since 2001, and I also have a background in academic teaching and research, principally in theoretical and computational physics.

Why did you choose Ruby?

The immediate reason for choosing Ruby was because Rails looked so promising, but I had dabbled in it before because I have an interest in dynamic programming languages. There’s a fairly short list of “languages that don’t suck”, and Ruby is one of them. (Python and Scheme are two others.)

Why is Ruby a good language to learn?

As Ruby creator Yukihiro “Matz” Matsumoto is fond of saying, Ruby is optimized for programmer happiness. The syntax is friendly, the design is clean but not rigidly pedantic, and the community is great. Ruby is fun!

How should I proceed to learn Ruby?

It depends on your goals. If you primarily want to develop web applications, I recommend taking the plunge and starting with Rails.
For Ruby itself, I like Beginning Ruby by Peter Cooper and The Well-Grounded Rubyist by David A. Black, and I’ve also heard good things about the latest edition of Programming Ruby. If you don’t want to commit to a whole book, Try Ruby is a fun place to start.

When did you start working on Rails? What was the motivation?

I started working with Rails in late 2005. I had written my own half-baked web framework (in Python) for a startup I cofounded with a friend, and when I looked at Rails I saw that it solved, in a better way, virtually every issue I had encountered when doing web development. I knew I wanted to keep making web applications, so Rails was a natural fit.

How would you briefly describe Rails from your perspective to new users?
Why should they consider it?

Rails is by far the most productive framework I’ve ever seen for making dynamic web applications. It can be a rather daunting challenge, though—web development is hard, and Rails is (of necessity) a large framework. Almost all experienced Rails developers underestimate how difficult it is to get started, which is one of the reasons I made the Ruby on Rails Tutorial. It’s a 500-page book and more than 15 hours of screencasts, so I didn’t hold anything back!

What operating system do you prefer?

I used Linux as my primary desktop OS from 1997 to 2007. These days I use OS X for development and Linux for deployment.

What is your development environment look like? (Text Editor, Web browser, etc.)

TextMate + iTerm + Firefox (and sometimes Chrome)

Do you have a blog, website?

I have a minimalist tech blog, which is mainly a place where I dump the occasional error message with solution (to help people following the “Google the error message” algorithm). But blogging isn’t my natural medium; I prefer long-form narrative instruction, which is what you’ll find in the Ruby on Rails Tutorial book (a 500-page book available for free online), the Ruby on Rails Tutorial screencasts, and the Ruby on Rails 3 Tutorial print edition.

What do you do in your free time?

I enjoy attending various tech-themed events in Los Angeles and Silicon Valley, I read old books, and I sing in the Caltech Glee Club. I also stay in shape through a combination of strength training and yoga.

What are your future plans?

I have a four-step plan for world domination. :-) I’m not sure if all four steps will actually happen, but at the very least I plan to produce more technical educational products. More mathematically inclined readers can get a preview of what to expect by visiting The Tau Manifesto, my notorious anti-pi propaganda piece.
Of course, I’m likely to make more Ruby- and Rails-themed products as well.

Something you want to add?

If you ever get discouraged when learning to program, it’s important to remember that software development is hard. I went to Harvard and have a Ph.D. in theoretical astrophysics from Caltech, and yet I feel stupid all the time. You just have to learn how to stay positive and power through the many problems that inevitably arise.

, , , , , , , (Intressant)





Interview with John Nunemaker

Posted by LessCode on February 17, 2011

Please tell us a bit about yourself and your background.
John Nunemaker
I am John Nunemaker and I live in South Bend, IN. I grew up a farm boy and fell in love with web development during a course in college in 2003. I love riding my motorcycle and am a sucker for TV and movies. I am a partner at Ordered List, where we build beautiful and simple software.

Why did you choose Ruby?
Code aesthetics have always mattered to me. Ruby is the prettiest and most expressive language I have used. Initially though, I came to Ruby because of Rails. While I still like Rails, Ruby is what keeps me excited. 

Why is Ruby a good language to learn?
I think it is easy to read, for the most part. Another huge reason is the community. Ruby has a huge community with a lot of smart people doing cool things. 

How should I proceed to learn Ruby?
I started Ruby back in 2005 or 2006 so I can barely remember what I did. I would attack it the way I attack anything if I had to learn it over. I usually start with articles and books, then move on to actually building something. 

When did you start working on Rails? What was the motivation?
http://weblog.rubyonrails.org/2005/7/24/buy-the-language-and-framework-get-practices-for-free

2005. I played with it a bit and wrote up a blog post which was picked up by the Rails blog. That said, I did not really get into it until 2006 probably. The main motivation was the same as for most people that get into Rails, it does a great job and making most things mundane so you can really think about the problem.

How would you briefly describe Rails from your perspective to new users?
Why should they consider it?
Rails is boring, and that is good. It makes all the things that you would typically do in an application really easy, sometimes too easy. This allows you to focus on the business problem at hand instead of writing validations and SQL queries. 

What operating system do you prefer?
Mac. Not even close. :)  

What is your development environment look like? (Text Editor, Web browser, etc.)
Currently, I use Chrome for browsing, with some Safari mixed in. I recently switched from TextMate to Sublime Text 2 for my editor. It has some really cool features. I use iTerm for CLI stuff, mostly because I love the full screen (same with Sublime). While I sometimes commit from the command line, I really enjoy looking things over in Gitx most of the time.

Do you have a blog, website?
I have a few blogs. The most active being my personal blog, RailsTips and my company blog, Ordered List. Over the past year I have grown quite fond of MongoDB, so I post occasionally to http://mongotips.com as well.

What do you do in your free time?
I watch a lot of moves and TV. Relaxes my brain. Weather permitting, I love riding motorcycle. 

What are your future plans?
A big goal for us is to become a product company. Almost immediately after I joined Ordered List, we started on Harmony http://harmonyapp.com. We build and manage a lot of websites, and nothing out there quite suited how we work. 

Another thing that we do a lot is speak at conferences. We quickly became frustrated with the current state of sharing presentations online, so we started SpeakerDeck http://speakerdeck.com

More recently (past few weeks), we have started on a third project for simple website analytics named Gauges.

My future is growing these products and any new ones we develop, and I am very excited

, , , , , , , , (Intressant)





Interview with Anil Wadghule 3

Posted by LessCode on February 10, 2011

Please tell us a bit about yourself and your background.
Anil Wadghule
I am Anil Wadghule, live in Pune, India. I am an engineer in computer science by academics, a software developer by profession, a geek by heart, a hacker by choice & brain. These days, I work for a software company in Pune as a Senior Ruby on Rails developer.

Why did you choose Ruby?

Early 2006, I found the book ‘Why’s (Poignant) Guide to Ruby’ via del.icio.us popular page. I read it. I liked _why’s RedHanded blog posts about Ruby that time. I came across my friend Premshree’s (a guy who used to work at Yahoo!) nice blogs and slides about Ruby. I started liking Ruby’s syntax. Later I read online version of ‘Programming Ruby’ I had become more comfortable Ruby language by that time. And fortunately, I got my first job in a small Ruby/Rails shop in Pune. That’s how my journey into Ruby programming started.

Why is Ruby a good language to learn?
Ruby is fully object oriented. Ruby got a very nice syntax. Ruby is useful general purpose programming language. Ruby’s metaprogramming features are amazing and powerful. I think for beginners to programming world, Ruby is definitely very a good programming language to learn. You might need some more time to grasp advanced Ruby concepts, but once learned you will find it very easy.

How should I proceed to learn Ruby?
Read online version of ‘Programming Ruby’ first. It’s very good book to read and get familiar to Ruby. Crisp and clear. Then, only thing you need to do is “Read more code. Write more code”. You can start a side project with Ruby. Keep IRB console open all the time for instant trying out Ruby concepts if you get stuck somewhere.

When did you start working on Rails? What was the motivation?
I started using Rails at my first job for a client project. I got chance to read and try out code in “Agile Web Development with Rails” first week. That was really awesome time. The screencasts on the Ruby on Rails site http://rubyonrails.org/screencasts were really inspiring. Rails was pure enjoyment for developing web applications. Loved Rails migrations, scaffold support. I still appreciate all the generators, scripts, rake tasks come bundled with new Rails app. I still remember initial feeling of pure awesomeness while developing apps with Rails.

How would you briefly describe Rails from your perspective to new users?
Why should they consider it?

A new Rails app comes with good setup of tools e.g. generators, scaffold, rake tasks, database, migrations. It’s a MVC architecture. It has very good folder structure. Once new users get Rails’ convention over configuration thing, they will find everything so easy and they will start liking it. Rails definitely helps to build awesome web apps quick and fast. Rails got a good documentation http://api.rubyonrails.org/. Rails 3 is written modular way. It insists avoiding monkey patching. Things like ActiveModel, ARel, Rack etc. generalizes concepts. You can easily swap out pieces as you wanted.

What operating system do you prefer?
OSX. I use my Macbook Pro 13. At work, I used to work with laptop/deskop having Ubuntu installed on it, now prefer Mac only. For servers, I prefer Ubuntu because it’s more familiar to me.

What is your development environment look like? (Text Editor, Web browser, etc.)
I use Emacs as my Editor http://emacsformacosx.com/
You can have look at my Emacs config here
https://github.com/anildigital/emacs
I use Google Chrome as my primary web browser. Since very start, I use dev channel version of Google Chrome

Nowadays, I use iTerm 2 as my terminal. I also use tmux http://tmux.sourceforge.net/ awesome terminal multiplexer.

Do you have a blog, website?

Website: http://anilwadghule.com/

Tumbleog: http://esotericdigital.typepad.com/

Twitter: http://twitter.com/anildigital

What do you do in your free time?
In my free time, I like to work on my side projects, contribute to open source projects e.g. Rails, JRuby. I try to build something small & useful with Clojure, Erlang, Node.js. Backbone.js, CoffeeScript. Sometime I watch movies but I regularly listen to music. I specially love & get inspired by A.R. Rahman’s music. Do you know, he might get an Oscar for the movie ’127 Hours’? He already got 2 Oscar nominations for it. Lets see what happens.

What are your future plans?
I am doing consulting for a project since last few months. Things are going good there. In very near future my plan is either work for a small Rails shop/startup or if all goes well, I would love to start my own consultancy and build & ship my own products in the remaining time.

Something you want to add?
Thanks for giving me chance for this interview :) . I would like to share that, I am available for hire for your Rails projects. Contact me anil@digitalcodes.org

, , , , , , , (Intressant)





Ok nu är det på allvar

Posted by LessCode on February 08, 2011

Det var ett tag sen jag bloggade men nu ska jag börja blogga igen.
Ok varför har bloggen varit nere varför har jag inte bloggat jo för att i somras började jag jobba i Åre och hade inte tid med bloggandet men nu har jag flyttat till Hoting i Jämtland där jag har tagit över ett gatukök tillsammans med min fru där vi ska jobba tillsammans i några år samtidigt som jag utvecklar mina kunskaper i ruby on rails och webbutveckling.
Men hur ska det gå till med att driva ett gatukök och utveckla kunskaperna i ruby on rails jo jag har planerat att en timme på morgonen och en timme på kvällen ska räcka till att lära sig lite grann varje dag.

Lite om Hoting
Hoting är en tätort i Strömsunds kommun och ligger 50 kilometer nordost om Strömsund med omkring 800 invånare.
Sevärdheter Stationshuset, Forntidsmuseet,bygdegården Valågården och Hotings bilmuseum.

, , , , , , , (Intressant)





Hitta jobbet

Posted by LessCode on February 08, 2011