Simple Treetop based parser for converting a subset of data output by the php var_dump() function to ruby.
Based on the code from http://thingsaaronmade.com/blog/a-quick-intro-to-writing-a-parser-using-treetop.html
module GemSideLoad | |
class << self | |
attr_accessor :last | |
end | |
module Gem | |
VERSION = '1.0.0' | |
Requirement = Struct.new(:wat) | |
Version = Struct.new(:version) | |
class Version | |
def >=(other) |
diff --git a/Rakefile b/Rakefile | |
index 67b32ec..e5d2660 100644 | |
--- a/Rakefile | |
+++ b/Rakefile | |
@@ -5,13 +5,27 @@ require 'rake/clean' | |
require 'bundler/gem_tasks' | |
require 'rspec/core/rake_task' | |
require 'ffi-compiler/compile_task' | |
+require 'mini_portile2' | |
+ |
#!/usr/bin/env ruby | |
# See http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ATreeViewColumn | |
# for more details on Gtk::TreeViewColumn | |
require 'gtk2' | |
require 'base64' | |
win = Gtk::Window.new("Multiple cells in a column") | |
win.signal_connect('delete-event') { Gtk.main_quit } |
require 'shellwords' | |
def curl_command(uri, http_get) | |
curl = ['curl', '--http1.1'] | |
http_get.each_capitalized do |h,v| | |
case h | |
when 'User-Agent' | |
curl << '--user-agent' << v | |
else | |
curl << '-H' << "#{h}: #{v}" |
require 'cairo' | |
require 'pango' | |
width, height = 600, 600 | |
surface = Cairo::ImageSurface.new(:argb32, width, height) | |
cr = Cairo::Context.new(surface) | |
cr.save do |
#!/bin/bash | |
git tag | ruby -e 'a=b=nil;loop { a, b=ARGF.gets, a; a and b and (STDOUT << "#{a.strip} : ") and system("git diff --name-status #{b.strip} #{a.strip}| wc -l"); a.nil? and b.nil? and break }' |
@-webkit-keyframes pulsate { | |
0% { | |
background-position: 0 0; | |
} | |
100% { | |
background-position: 300px 0; | |
} | |
} | |
div.animated { |
def grad_vl(y1,y2,col1=nil,col2=nil,&block) | |
pattern= Cairo::LinearPattern.new(0, y1, 0, y2) | |
{0=>col1,1=>col2}.each do |offset, col| | |
next unless col | |
case col.size | |
when 3 | |
pattern.add_color_stop_rgb(offset, *col) | |
when 4 | |
pattern.add_color_stop_rgba(offset, *col) | |
end |
require 'usb' | |
require 'pp' | |
class StutsCar | |
attr_reader :handle | |
def initialize(handle) | |
@handle = handle | |
@handle.public_methods(false) | |
@handle.usb_detach_kernel_driver_np(0, 0) rescue nil | |
@handle.usb_claim_interface(0) rescue nil |
Simple Treetop based parser for converting a subset of data output by the php var_dump() function to ruby.
Based on the code from http://thingsaaronmade.com/blog/a-quick-intro-to-writing-a-parser-using-treetop.html