Fixing the error: 'webkit_server: cannot connect to X server'

What?

If you are using capybara-webkit to do integration tests in a Ubuntu server distribution like Vagrant or a remote dev server, you may see an error like this:

webkit_server: cannot connect to X server

Don't worry, that's because Ubuntu server don't have an X server running, for those wondering what is a X server:

"An X server is a program in the X Window System that runs on local machines (i.e., the computers used directly by users) and handles all access to the graphics cards, display screens and input devices (typically a keyboard and mouse) on those computers. "

My dev environment for 2013 lol

Hello Folks, I would like to share my current DEV environment for Ruby/Rails Fulltime. There is nothing too fancy, just a simple and productive environment.

Macbook pro mid 2010

Yes, i'm still coding on a Macbook pro mid 2010, why? It's enough! It is not the fastest machine on earth but it is enough for ruby/rails/web development in general, i use it mostly for work/feeds/internet-shit. Gamming? Forget about it, i use my iPhone 4S and my xbox to do that.


Bro apps - Hire us!

Bros

Me and a friend decided to give a shot and start working together, we have years of web development experience, specially rails.

What we do?

We craft web applications according to your needs using agile practices and technologies such as Ruby, Rails and JavaScript.

Contact us

Need someone to get your project done? Know a friend that need a fast project delivery? Contact us trough http://broapps.co

Thank you guys, see you soon.


Javascript Templates using eco

Writting inline HTML output with Javascript, fuuuuu

Have you ever used Javascript templates? No? Let's write an example. Imagine if you have a function that receives some data in json format and you should add this data in a human format to the html body of the application.

function renderData(data) {
  output = "<li class='"+ data.class+"'>"+ data.name +"</li>";
  $("body").append(output);
}

Mounting the output string can be a pain in the ass some times, usually you will need to concatenate a lot of data to format the html output. Javascript templates are here to make it easy.

Eco: Embedded CoffeeScript templates

https://github.com/sstephenson/eco

Eco lets you embed CoffeeScript logic in your markup. It's like EJS and ERB, but with CoffeeScript inside the <% ... %>. Use it from Node.js to render your application's views on the server side, or compile your templates to JavaScript with the Eco command-line utility and use them to dynamically render views in the browser.


Jhimy Fernandes Villar 2013