Ruby on Rails, a powerful web development framework, has been pivotal in building robust web applications with its Model-View-Controller (MVC) architecture. However, the integration of Artificial Intelligence (AI) within Ruby on Rails marks a revolutionary stride, offering unprecedented capabilities in web application development. Revolutionizing Web Development with AI AI’s integration into Ruby on Rails opens […]
Extended Euclidean Algorithm Function
A function for finding the modular multiplicative inverse, based on an extended version of the Euclidean algorithm.
Round Floating Point Numbers
Custom floating point rounding based on three functions that allow you to round to a certain precision, round up and round down.
Convert Pixels To Centimeters
A Ruby function that can be easily adapted to work with any language, because it uses a simple division and multiplication to calculate the number of centimeters in the given pixel size.
Format Number As Currency
Add the commas that separate digits in large numbers using this FormatCurrency function for Ruby.
Write A PDF File Using Ruby
Using the open source PDF::Writer library for Ruby to create PDF documents on the fly and save them on the server.
Get the Number of Days in a Month Using Ruby
With a one-line function you can retrieve the number of days in a given month. Month must be passed as a number (1 to 12.)
Validate a String For a Certain Amount of Numbers
Using regular expressions in Ruby you can validate a string for a certain amount of numbers.
Check if an URL is Available
Generate Random Password using Ruby
This code defines a function that allows you to generate an easily readable password of the specified length, containing only valid characters.