mardi 29 mai 2012

Using NuGet with mono on Debian

I tried to use NuGet on my Debian installation and I had several issues to solve. Thanks to this and this link, I was finally able to make it work! Here are the steps:

First install mono with all the SDK:
$ sudo apt-get install mono-complete
Install https certificate so that Mono can trust the source for NuGet
$ mozroots --import --sync

Download NuGet command line bootstrapper (NuGet.exe)

Copy MsBuild dll from Microsoft and put it in the same directory as NuGet.exe. You can find this dll in a Windows OS here "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.dll" or you can find it in Windows SDK for .NET framework 4.0

Finally, running this command line should show help information
$ mono --runtime=v4.0.30319 NuGet.exe
And you should be able to download any package with
$ mono --runtime=v4.0.30319 NuGet.exe Install Cassette.Web

jeudi 26 avril 2012

Setup for new rails project with RSpec

I like to use RSpec instead of Test::Unit for my rails projects. Here are the steps I use to setup my projects.
Create new rails project without Test::Unit
rails new MYAPP -T
Add rspec-rails to your Gemfile:
gem 'rspec-rails'
Choose a javascript runtime in the Gemfile:
gem 'therubyracer', :platform => :ruby
Run bundle install:
bundle install
Install rspec in rails:
rails g rspec:install
Let's write the first spec!

mardi 7 février 2012

Debian gem install RMagick

I tried to install RMagick gem on my Debian box and got the following error:
checking for Magick-config... no
Can't install RMagick 2.3.0. Can't find Magick-config in [...]
I installed libmagickcore-dev:
sudo apt-get install libmagickcore-dev
But I still had an error with:
Can't find MagickWand.h
The problem was solved by installing libmagickwand-dev:
sudo apt-get install libmagickwand-dev
Hope that helps!

jeudi 2 février 2012

Review of "JavaScript & jQuery: The Missing Manual, Second Edition" by David Sawyer McFarland; O’Reilly Media

Disclaimer: I'm a member of the O'Reilly Blogger Review Program and as such, this book was freely provided to me by the editor.

David Sawyer McFarland has been building websites since 1995. In "JavaScript & jQuery: The Missing Manual", he tries to teach javascript and jQuery to web designers or beginner programmers so that they can build highly interactive web pages. This book is clearly aimed to people who know a little bit of HTML and CSS but want to add some dynamics to their pages.

The first two parts of the book teach the reader basics of javascript and jQuery. It begins with very basic things like "What's a Computer Program" and finishes with a tutorial to write an animated dashboard in jQuery. I have to say that I skipped most of these 200 pages as I already know most of what is written here.

The third part of the book gives lots of tips for improving images and navigation in your website. There are lots of tutorial which cover the most frequent cases that you find on modern websites. I liked the chapter on web forms for it introduce some very useful techniques for having smarter forms and interfaces.

The fourth part was clearly the most interesting to me: Ajax. David goes back to the basics of request/response and explains trough simple tutorials how Ajax works with jQuery. All you need to know to be able to make Ajax with jQuery is here! Moreover, the next chapter show how to use these new skills with popular web services from Flickr or Google Maps.

Finally, the last part "Tips, Tricks, and Troubleshooting" explain how to work with jQuery and javascript efficiently in a daily basis with things like traversing the DOM, regex and debugging.

I was a bit disappointed at the beginning as the first 200 pages are really very basic but then, I learned lots of practical tips that I will be able to use in all my web projects.