Welcome To Snipplr


Everyone's Recent Ruby Snippets



« Prev 1 2 3 4 5 ... 12
  1. FAV

    30 fibonacci numbers without using numbers in Ruby

    30 fibonacci numbers without using numbers in Ruby (64 characters)
    Ruby 6 views posted 5 years ago by adino
  2. FAV

    Convert Email to Other Formats using Cloud API in Ruby

    This technical tip shows how developers can convert email messages to other formats like EML, MSG & MHT in cloud using ruby language.
    Ruby 4 views posted 5 years ago by johansonkatherine
  3. FAV

    Ruby Code Sample to Create PDF from HTML Using REST API

    This code sample shows how Ruby developers can create PDF file from HTML using Aspose.Pdf for Cloud API in their REST applications.
    Ruby 5 views posted 5 years ago by johansonkatherine
  4. FAV

    Seeding database from .XLS file

    I had a spreadsheet with a ton of data on it that I wanted in my seeds file. Using example columns in your database titled db_column1, db_column2, db_column3. Place your .xls file into your public folder and run 'gem install roo'
    Ruby 7 views posted 6 years ago by asalgan
  5. FAV

    Turn CSV With Headers Into Array Of Hashes

    To be improved to work with fasterCSV
    Ruby 4 views posted 6 years ago by legrandkay
  6. FAV

    Load Simple Pag Nokogiri

    Ejemplo de Carga de Página con Nokogiri
    Ruby 6 views posted 6 years ago by danielousky
  7. FAV

    Get string between two strings

    If you're using Rails and want to make this a global function, drop this into your application_controller and call it as a function. Example: # get_string_between("hellomyfriendmoto", 'o', 'm') # > myfriend
    Ruby 11 views posted 6 years ago by joshmn
  8. FAV

    `rb output margin

    Ruby 4 views posted 6 years ago by zhaowu
  9. FAV

    Scale a number into a defined range

    Scales a number from a given range into a specific range, as explained [in this Stack Overflow](http://stackoverflow.com/questions/5294955/how-to-scale-down-a-range-of-numbers-with-a-known-min-and-max-value) post. Just call it, for example like:...
    Ruby 12 views posted 7 years ago by slhck
  10. FAV

    Rake Task for Rails

    = Rake Task for Rails * name: name of the task * desc: description of the task
    Ruby 8 views posted 7 years ago by cliffbraton
  11. FAV

    Capture Screenshots in Ruby

    Use this Gem to programmatically take screenshots of websites with this completely open source and free library. We have also provided easy to follow online tutorials and sample applications to help you set up GrabzIt as quickly as possible. First...
    Ruby saved by 4 people 13 views posted 7 years ago by Maximus1983
  12. FAV

    Ruby: Search Spotify API

    Simple test showing how to make a request to Spotify's API.
    Ruby saved by 2 people 17 views posted 8 years ago by chrisaiv
  13. FAV

    Extract most common colors from an image

    Takes an image (path or url) and extracts the 7 most common colors and returns their hex values.
    Ruby 15 views posted 8 years ago by kellishaver
  14. FAV

    Image Uploading in Ruby

    Checks to make sure the file is a valid image file, checks max file size, and directory write permissions, requires 'fileutils' gem.
    Ruby saved by 18 people 15 views posted 8 years ago by kellishaver
  15. FAV

    Fetch remote JSON in Ruby

    An example method for fetching remote JSON data in Ruby.
    Ruby saved by 32 people 8 views posted 8 years ago by vestimir
  16. FAV

    Ruby: Parsing Blackberry Download Reports

    The Blackberry AppWorld portal allows you to schedule reports which are delivered as CSV.zip files. Although the CSV file offers a lot of detail about operating system and date of download, most of the time I just want to know which users downloaded...
    Ruby 7 views posted 8 years ago by chrisaiv
  17. FAV

    Finding strings in Files in Ruby

    Ruby 9 views posted 8 years ago by scruffpuff
  18. FAV

    Singleton Pattern MacRuby

    Works fine for MacRuby applications
    Ruby 7 views posted 8 years ago by iloveitaly
  19. FAV

    Ruby: SMPTE Converter

    If you need to do any sort of screen capturing using FFMPEG, you might need this one day
    Ruby 4 views posted 8 years ago by chrisaiv
  20. FAV

    Ruby CSV writing and reading example with quotes, line breaks and commas in the fields

    Shows how to read/write fully formatted CSV with Ruby
    Ruby saved by 4 people 6 views posted 8 years ago by m1b
  21. FAV

    Ruby class and instance variables lifecycle across inheritance demo

    Ruby 6 views posted 8 years ago by m1b
  22. FAV

    Search for remote gems from command line and view detailed results in textmate

    Do a remote search for all gems containing the word 'pdf' with detailed descriptions and view results in textmate requires `rubygems-mate` gem
    Ruby 6 views posted 8 years ago by inkdeep
  23. FAV

    Add directory to load path

    Ruby 6 views posted 8 years ago by inkdeep
  24. FAV

    Require directory of files

    Ruby 8 views posted 8 years ago by inkdeep
  25. FAV

    Ruby numero aleatorio

    asdads
    Ruby 4 views posted 8 years ago by solhelios
  26. FAV

    Plus three numbers

    para sumar tres numbres
    Ruby 4 views posted 8 years ago by solhelios
  27. FAV

    Pasador de euros pesetas

    pasa euros a pesetas
    Ruby 5 views posted 8 years ago by solhelios
  28. FAV

    How to control de age in yout programs

    A program fronm controlate your programs with dea age
    Ruby 5 views posted 8 years ago by solhelios
  29. FAV

    Ruby: CSV to XML (Version 2)

    I use this code snippet all the time. It allows me to parse a CSV file and transform it into an XML file.
    Ruby 6 views posted 8 years ago by chrisaiv
  30. FAV

    Calculator y clave y contraseña in ruby

    Programa de una calculadora en ruby ademas de contraseña y usuario
    Ruby 5 views posted 8 years ago by solhelios
« Prev 1 2 3 4 5 ... 12