Skip to content

Instantly share code, notes, and snippets.

module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Hash #:nodoc:
module Conversions
module ClassMethods
def typecast_xml_value(value)
case value.class.to_s
when 'Hash'
if value['type'] == 'array'
# If it has more than 2 keys tag has attributes
require 'active_support'
Hash.from_xml('
<projects page="1" per_page="3" type="array">
<project>
<name>project 1</name>
</project>
<project>
<name>project 2</name>
</project>
<project>
import java_cup.runtime.*;
import java.io.*;
import java.util.Hashtable;
import java_cup.runtime.Symbol;
parser code {:
public static void main(String argv[]) throws Exception {
String fInName = argv[0];
int n = 0, nErrors = 0;
if (argv.length !=1) {
=== hpricot-test.rb (1)
user system total real
bp.xml 0.070000 0.000000 0.070000 ( 0.070721)
posts.xml 0.000000 0.000000 0.000000 ( 0.001641)
timeline.xml 0.040000 0.000000 0.040000 ( 0.038301)
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
hydrus 18686 60.4 0,3 610836 11620 s004 S+ 11:23AM 0:00.29 ruby hpricot-test.rb 1
$ ruby itunes.rb
Top Gratuitas
====================
1 - WiFi Telefónica
2 - Burning Tires™ 3D Lite
3 - SHOUTcast Radio
4 - COPE
5 - Toy Tanks™ 3D Lite
6 - SuperDial
7 - iMob Online
require 'lib/tvtrack'
config = TVTrack::Config.instance
config[:username] = 'USUARIO'
config[:password] = 'PASSWORD'
puts "Running at #{Time.now}"
eztv = TVTrack::Base.instance
eztv.download_torrents
class TestController < ApplicationController
include Tractis::IdentityVerifications
def create
valid_tractis_identity_verification!("API-KEY", params)
render :text => <<-TEXT
<pre>
Identified
Name: #{params["tractis:attribute:name"]}
eID #: #{params["tractis:attribute:dni"]}
<% form_for_identity_verification_gateway("API-KEY", {:action => 'create'}, {:public_verification => true}) do %>
<%= hidden_field_tag 'lang', 'en' %>
<%= submit_tag "Identificarse" %>
<% end %>
#!/usr/bin/env bash
# By: Ernesto Jiménez <erjica@gmail.com>
#
# This script will generate aliases for all your applications
# in your /Applications folder in OS X allowing you to easily
# open applications from your command line.
# Examples:
# safari http://ernesto-jimenez.com
# finder ~
# quicktime-player /path/to/video.mov
% Fue ver implementado el QuickSort en Erlang
% Y acto seguido estaba comprando un libro de Erlang en Amazon
quicksort([]) -> [];
quicksort([Pivot|Rest]) ->
quicksort([Front || Front <- Rest, Front < Pivot])
++ [Pivot] ++
quicksort([Back || Back <- Rest, Back >= Pivot])