background preloader

Blog of Ryan Bigg - Ubuntu, Ruby, RVM, Rails, and You

Blog of Ryan Bigg - Ubuntu, Ruby, RVM, Rails, and You
Related:  Ruby Developmentjuan144

Pasar funcion como parametro. 2: Multiples parametros. : Software over the rainbow En una entrada anterior comentaba cómo pasar el nombre de una función a otra como parámetro. Sin embargo, no sabía cómo pasarle un número indeterminado de parámetros a la función llamada. Tras varios intentos fallidos, lo dejé en el tintero. Hoy, buscando otra cosa, he encontrado lo que me quedaba para solucionarlo en otro blog. Me explico: Cada vez que llamamos una función, de forma predefinida se crea dentro de esta un array de nombre arguments, que almacena todos los parámetros pasados. function a(param1, param2, param3) { trace(arguments); } a ("pepe", "juan", "jorge"); // la ventana de salida muestra : pepe, juan, jorge // * ya lo se, qué parametros mas aburridos * Dado que arguments es un array, podemos hacer todas las operaciones de esta clase con ella. function a(param1, param2, param3) { trace(arguments.length); } a ("pepe", "juan", "jorge"); // la ventana de salida muestra : 3 La idea era pasar el array de parámetros de una funcion a la segunda, pero ahí me quedé. Y eso es todo.

AppSumo: A Discount Bundle of Webapp Credits Suited to Ruby Developers By Peter Cooper / November 14, 2010 AppSumo is an intriguing "bad ass developer bundle" that brings together $1543 of credit for ten different Web app development related resources (most are Ruby focused or have Ruby APIs) for a mere $47 purchase. The services include: Twilio - an API driven telephony service (I use this — it's great)Heroku - the Ruby webapp hosting environmentHoptoad - the errors notification serviceNew Relic - the performance monitoring and application management serviceAs well as Recurly, SendGrid, MongoHQ, SauceLabs, Infochimps and Linode. Sadly I'm already signed up with most of these services and most of the credits are for new or upgraded accounts only, but if you want to give any of the above services a try or want to build a new app that relies on them, this looks like a steal. I also need to put a big fat disclaimer here in case you have problems with AppSumo: I'm not related to AppSumo, getting nothing from them (shame!)

Ruby on Rails Tutorial: Learn Rails by Example | Ruby on Rails 3 Tutorial book and screencasts | by Michael Hartl Michael Hartl Contents Foreword My former company (CD Baby) was one of the first to loudly switch to Ruby on Rails, and then even more loudly switch back to PHP (Google me to read about the drama). Though I’ve worked my way through many Rails books, this is the one that finally made me “get” it. The linear narrative is such a great format. Enjoy! Derek Sivers ( Founder, CD Baby Acknowledgments The Ruby on Rails Tutorial owes a lot to my previous Rails book, RailsSpace, and hence to my coauthor Aurelius Prochazka. I’d like to acknowledge a long list of Rubyists who have taught and inspired me over the years: David Heinemeier Hansson, Yehuda Katz, Carl Lerche, Jeremy Kemper, Xavier Noria, Ryan Bates, Geoffrey Grosenbach, Peter Cooper, Matt Aimonetti, Gregg Pollack, Wayne E. About the author Michael Hartl is the author of the Ruby on Rails Tutorial, the leading introduction to web development with Ruby on Rails. Copyright and license Welcome to the Ruby on Rails Tutorial.

Things To Tweak / Fix After Installing Ubuntu 11.04 Natty Narwhal A note before reading this post: before giving up on Unity without giving it a try... don't. Try Unity for a few days - yes, it's not a finished product but it's actually quite interesting - and if you don't like it then switch. If you've just upgraded to Ubuntu 11.04 Natty Narwhal, there are probably a few things you'll miss, so here is how to get them back as well as some other things you may find useful. Install CompizConfig Settings Manager and Tweak Unity to better suit your needs: sudo apt-get install compizconfig-settings-manager Then search for CompizConfig Settings Manager in Dash and you'll find the Unity-related options under the "Unity" Compiz plugin. Using CCSM, you'll be able to tweak the Unity launcher reveal mode, hide behavior, change some Unity-specific keyboard shortcuts, change the Unity launcher icon size, the top panel opacity, tweak various animations and more. Another tool for configuring some hidden Unity settings is Dconf-editor. sudo apt-get install dconf-tools

Twitter Bootstrap, Less, and Sass: Understanding Your Options for Rails 3.1 » RubySource By now, we’ve all seen Twitter Bootstrap – it’s a great CSS and Javascript library open sourced by Twitter that makes it easy to produce a very polished looking site, with fantastic support for layout, navigation, typography, and much more. Twitter Bootstrap is based on Less.js, the popular dynamic CSS scripting language written by Alexis Sellier or @cloudhead. Less.js, like Node.js, is implemented completely with Javascript. While Less is based on Javascript and not Ruby, some great work has been done just in the last couple of months to make it easy to set up Twitter Bootstrap in your Rails 3.1 app using a variety of different approaches. Today I’m going to review the basics of Twitter Bootstrap, and then take a close look at the following gems and libraries: less-rails-bootstrap, sass-twitter-bootstrap, bootstrap-sass and bootstrap-rails. Twitter Bootstrap basics $ git clone $ cp bootstrap/bootstrap.css path/to/app/assets/stylesheets/.

arguments: A JavaScript Oddity arguments is the name of a local, array-like object available inside every function. It’s quirky, often ignored, but the source of much programming wizardry; all the major JavaScript libraries tap into the power of the arguments object. It’s something every JavaScript programmer should become familiar with. Inside any function you can access it through the variable: arguments, and it contains an array of all the arguments that were supplied to the function when it was called. It’s not actually a JavaScript array; typeof arguments will return the value: "object". You can access the individual argument values through an array index, and it has a length property like other arrays, but it doesn’t have the standard Array methods like push and pop. Create Flexible Functions Even though it may appear limited, arguments is a very useful object. format("And the %1 want to know whose %2 you %3", "papers", "shirt", "wear"); Convert it to a Real Array var args =;

A Look Into Ruby’s Object Model By Peter Cooper / November 3, 2010 A few days ago, Burke Libbey, a Winnipeg based Ruby and Rails developer, gave a presentation called Ruby's Object Model: Metaprogramming and Other Magic to the Winnipeg.rb Ruby user group. I though it was interesting enough to embed here. Presentations about metaprogramming and how the Ruby object model works are hardly anything new, but Burke has approached it in a friendly, easy to understand (though terse - but that's why it's a presentation) fashion, despite including the relevant C from MRI on the slides. Note: If your reader doesn't support embedded presentations, click here to see the presentation on Slideshare.

Ruby QuickRef Table of Contents Language General Tips These are tips I’ve given over and over and over and over… Use 2 space indent, no tabs. See for more. General Syntax Rules Comments start with a pound/sharp (#) character and go to EOL. Reserved Words alias and BEGIN begin break case class def defined? Types Basic types are numbers, strings, ranges, regexen, symbols, arrays, and hashes. Numbers 1231_234123.451.2e-30xffff 0b01011 0377 ? Strings In all of the %() cases below, you may use any matching characters or any single character for delimiters. %[], %!! 'no interpolation'"#{interpolation}, and backslashes\n"%q(no interpolation)%Q(interpolation and backslashes)%(interpolation and backslashes)`echo command interpretation with interpolation and backslashes`%x(echo command interpretation with interpolation and backslashes) Backslashes: Here Docs: Encodings: Waaaay too much to cover here. Symbols Internalized String. Ranges 1..101...10'a'..' Regexen "r"

Installing Ruby in my Ubuntu environment. by mr.rsposton Oct 24