To mark deprecated code in Ruby simply add a comment to the rdoc and call the
Kernel#warnmethod. For example:class Foo # DEPRECATED: Please use useful instead. def useless warn "[DEPRECATION] `useless` is deprecated. Please use `useful` instead." useful end def ...
It’s often a requirement in various projects to convert numbers from decimal to text representations of several other bases, such as hexadecimal or binary.
Did you know you can convert to any base from 2 to 36 in one line in Ruby?Using the Fixnum#to_s method, you can quickly convert any Fixnum object to the textual format of another base:
255.to_s(36) #=> "73" 255.to_s(16) #=> "ff" 255.to_s(2) #=> "11111111"This tip was submitted by Nathan Kleyn.
Je vai faire du découpage ce we http://t.co/1n1stsFD
Avec la gauche les chars russe seront aux portes de paris #toiaussiparticipealaconventionump
RT @Photojojo: Photo of the day: a pig heart (identical to human hearts) stripped of surrounding tissue. http://j.mp/nuDFZS via @katetropa
Qui connait les paroles du thème musical de Star Wars ? | Gizmodo http://t.co/zP8Hzoz
Vivek’s blog: Validators.js - javascript based form validation using jQuery - v1v3kn: http://t.co/TkVbMAD
Validators.js is a javascript library for form validation that I wrote for my projects. It provides a simple and elegant interface for creating different types of form validators and chaining them together. Common functions like checking email addresses, matching a regular expression, checking for…