This file contains 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
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) |
This file contains 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
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' | |
+ |
This file contains 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 '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}" |
This file contains 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
#!/usr/bin/env ruby | |
require 'gdk_pixbuf2' | |
require 'fileutils' | |
# arg : String : filename | |
# sensitivity : Integer : greyscale distance between pixels for this to be considered an edge | |
# scale_to : Integer : max dimension (images are scaled down for performance reasons) | |
# | |
# Scales image down and then runs a simple edge detection algorithm in order to detect the active area |
This file contains 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
#!/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 }' |
This file contains 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
@-webkit-keyframes pulsate { | |
0% { | |
background-position: 0 0; | |
} | |
100% { | |
background-position: 300px 0; | |
} | |
} | |
div.animated { |
This file contains 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
#!/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 } |
This file contains 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
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 |
This file contains 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 'cairo' | |
require 'pango' | |
width, height = 600, 600 | |
surface = Cairo::ImageSurface.new(:argb32, width, height) | |
cr = Cairo::Context.new(surface) | |
cr.save do |
This file contains 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 '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 |
NewerOlder