This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'mechanize' | |
| agent = Mechanize.new | |
| puts agent.get('http://stackoverflow.com/questions/5023740/mechanize-table-scraping-problem').root().class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'java' | |
| require 'rubeus' | |
| # Rubeus.verbose = true | |
| Rubeus::Swing.irb | |
| JFrame.new('Hello') do | |
| |frame| | |
| frame.layout = BoxLayout.new(:Y_AXIS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyClass { | |
| public void doStuff() { | |
| System.out.println("hello"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sebastien@greystones:/tmp$ jruby singleton.rb | |
| hello | |
| world |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'optparse' | |
| require 'nokogiri' | |
| Dir.chdir(ARGV[0]) | |
| poms = File.join("**", "pom.xml") | |
| Dir.glob(poms).each do | |
| |p| | |
| puts p | |
| f = File.open(p) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'java' | |
| # Update with the name of jar you have downloaded | |
| require 'mysql-connector-java-5.0.8-bin.jar' | |
| Java::com.mysql.jdbc.Driver | |
| # Update the JDBC details as needed | |
| jdbc_url = 'jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8' | |
| login = 'sonar' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'date' | |
| class Commit | |
| attr_accessor :sha_id, :author, :date, :comment | |
| end | |
| commits = Hash.new | |
| commits_number = Hash.new { |k,v| k[v] = 0 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install-dev-gems: | |
| [java] Gem.ruby /home/sebastien/dev/jruby/bin/jruby | |
| [java] Gem.bindir /home/sebastien/dev/jruby/bin | |
| [java] INFO: gem "rake" is not installed | |
| [java] INFO: gem "rspec-core" is not installed | |
| [java] INFO: gem "diff-lcs" is not installed | |
| [java] INFO: gem "rspec-expectations" is not installed | |
| [java] INFO: gem "rspec-mocks" is not installed | |
| [java] INFO: gem "rspec" is not installed | |
| [java] Successfully installed rake-0.9.2.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sebastien@kilkenny:~$ rvm jruby-1.6.5.1 | |
| sebastien@kilkenny:~$ ruby strings.rb | |
| user system total real | |
| 21 chars 0.448000 0.000000 0.448000 ( 0.401000) | |
| 22 chars 0.213000 0.000000 0.213000 ( 0.213000) | |
| 23 chars 0.172000 0.000000 0.172000 ( 0.172000) | |
| 24 chars 0.201000 0.000000 0.201000 ( 0.201000) | |
| 25 chars 0.187000 0.000000 0.187000 ( 0.187000) | |
| 26 chars 0.174000 0.000000 0.174000 ( 0.174000) | |
| 27 chars 0.170000 0.000000 0.170000 ( 0.171000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sebastien@kilkenny:~$ rvm jruby-head | |
| sebastien@kilkenny:~$ ruby strings.rb | |
| user system total real | |
| 21 chars 0.445000 0.000000 0.445000 ( 0.415000) | |
| 22 chars 0.171000 0.000000 0.171000 ( 0.171000) | |
| 23 chars 0.160000 0.000000 0.160000 ( 0.160000) | |
| 24 chars 0.206000 0.000000 0.206000 ( 0.207000) | |
| 25 chars 0.172000 0.000000 0.172000 ( 0.172000) | |
| 26 chars 0.174000 0.000000 0.174000 ( 0.174000) | |
| 27 chars 0.176000 0.000000 0.176000 ( 0.176000) |
OlderNewer