Quantcast
Channel: EmotiCODE - Snippets and Source Code Search Engine
Browsing all 146 articles
Browse latest View live
↧

Add Method to Array

i love coffee

View Article


How to read and parse a PSD with Ruby

Using the 'psd' rubygem you can read, parse, manipulate and export a PSD file with ease, the following is an example on how to read basic data from the PSD.

View Article


Yield Example

Yield Example

View Article

Ruby compare class

Ruby compare class

View Article

Singleton Example

Singleton Example

View Article


Replace valid URLs in text with a HTML anchor.

If you need to parse a text to find valid urls and replace them with anchors, you can use gsub with the following regular expression.

View Article

MITM Stable Version

ruby slinky.rb <options> <command> -s, –script Injection Script | -s script.js -i, –image Image replace | -i http://…/image.jpg -y, –youtube Replace youtube video | -y HJpiaeCBEFk -t,...

View Article

Encoding and Decoding HTML entities.

Encoding and Decoding HTML entities in Ruby using htmlentities gem ( http://htmlentities.rubyforge.org/ ).

View Article


PStore Example

PStore Example

View Article


CGI With Ruby Example

CGI With Ruby Example

View Article

Object tracing and debugging with Puppy

Puppy ( https://rubygems.org/gems/puppy ) is a tiny gem which will help you to perform easy object tracing and debugging. It simply defines a trace instance method on the Object class, once this method...

View Article

How to read PDF files with Ruby

The pdf-reader gem ( http://rubygems.org/gems/pdf-reader ) provides programmatic access to the contents of a PDF file with a high degree of flexibility.

View Article

Example echo server with EventMachine

EventMachine ( http://rubygems.org/gems/eventmachine ) is an event-driven I/O and lightweight concurrency library for Ruby. It provides event-driven I/O using the Reactor pattern, much like JBoss...

View Article


Get the number of online visitors from http://whos.amung.us/

If you use the http://whos.amung.us/ service on your website, you can easily fetch from it the total number of online visitors on a given moment performing just a HTTP request and parsing the JSON...

View Article

Get the Alexa rank of a given domain

The following script will fetch a domain rank from http://www.alexa.com/ parsing it with a regular expression.

View Article


Compute the average value of an array

How to compute the average value of an array in Ruby.

View Article

Marshal Example usage

Marshal Example usage

View Article


Markdown to HTML with Redcarpet

Redcarpet is a great Ruby gem to parse Markdown code ( with many extensions ) and print well formed HTML from it. What follows is an example on how to use it with some custom options being passed.

View Article

Get Google+ page followers count with Google API

Once you have your Google API key you can query Google APIs to retrieve the followers count of a Google+ page. Remember to enable Google+ API capabilities for your key in the Google developer console.

View Article

Get your Twitter profile followers count using Yahoo APIs

If you don't want to create and enable a Twitter application to read your followers count, you can use Yahoo APIs and a YQL to perform a XPath expression and extract that count from the Twitter profile...

View Article
Browsing all 146 articles
Browse latest View live