Skip to content

Instantly share code, notes, and snippets.

View glurp's full-sized avatar

Abby Archer glurp

View GitHub Profile
@glurp
glurp / test.rb
Created October 16, 2011 23:20
gtkh exemple
def component()
stack do
slot(htoolbar({"open/ourir fichier"=>nil,"close/fermer le fichier"=>nil,
"undo/defaire"=>nil,"redo/refaire"=>proc { alert("e") },"ee"=>nil }))
slot(label( <<-EEND
This window is done with 55 LOC...
50 lines for create widgets, but don't do any traitment !
I will use that for Inscape extensions (SCADA Synoptics in SVG)
EEND
))
@glurp
glurp / hello.rb
Created February 22, 2012 23:09
Ruiby hello words
require_relative '../lib/ruiby'
class RubyApp1 < Ruiby_gtk
def component() slot( label("Hello, world!") ) end
end
. . . . . . . . . . . . . . .
class RubyApp0 < Ruiby_gtk
@glurp
glurp / calculator.rb
Created February 23, 2012 17:38
litle calculette, with Ruiby, without list!
require 'ruiby'
class App < Ruiby_gtk
####################### last result is '_' alias
def _()
@lastValue || 0
end
######### context evaluation formula : the context is the first call of b()
@glurp
glurp / guidemo.rb
Created March 13, 2012 21:41
femtows with gui
#require_relative "lib/femtows.rb"
#require_relative '../../Ruiby/lib/ruiby.rb'
require 'femtows'
require 'ruiby'
class Server < Ruiby_gtk
def initialize(t,w,h)
$server=self
@port=8100
@root="/"
@glurp
glurp / ginstall.r
Created March 15, 2012 09:03
auto gem install
module Kernel
def ruiby_require(*gems)
w=Ruiby_dialog.new
gems.flatten.each do|gem|
begin
require gem
rescue LoadError => e
rep=w.ask("<em>Loading #{gems.join(', ')}</em>\n\n'#{gem}' package is missing. Can I load it from internet ?")
exit! unless rep
require 'open3'
@glurp
glurp / images.rb
Created May 4, 2012 19:16
Show raster files images, with properties (image and widget)
require 'Ruiby'
if ARGV.size==0
Message.alert("Usage\n>ruby images.rb raster.png raster.gif ....")
exit
end
Ruiby.app(:width=> 800, :height=>800) do
vbox_scrolled(800,800) do
table(3,ARGV.size) do
@glurp
glurp / uifind.rb
Created November 23, 2012 16:59
uisync
# encoding: utf-8
###########################################################
# uiFind.rb : synvronise deux reperoire, a la rsync
###########################################################
require_relative 'Ruiby/lib/ruiby.rb'
require 'fileutils'
class Application < Ruiby_gtk
def initialize()
super("UiFind",100,0)
@glurp
glurp / ui.rb
Created November 23, 2012 17:01
uisync ui part
# encoding: utf-8
require_relative 'Ruiby/lib/ruiby.rb'
require_relative 'rfind.rb'
require 'fileutils'
class Application < Ruiby_gtk
def initialize()
super("UiFind",100,0)
threader(20)
end
@glurp
glurp / rupy.rb
Created December 11, 2012 12:16
convert ruby code formated 'a la python' to regular ruby code
####
#### transform ruby/dsl code with tabulation
#### block (a la python)to ruby block
####
if ARGV.size!=1 || !File.exists?(ARGV[0])
puts "Usage: > ruby #{$0} filename"
exit(1)
end
last_indent,no,h,last_key=0,0,{},""
@glurp
glurp / rupy.rb
Created December 11, 2012 12:17
convert ruby code formated 'a la python' to regular ruby code
####
#### transform ruby/dsl code with tabulation
#### block (a la python)to ruby block
####
p RUBY_VERSION
if ARGV.size!=1 || !File.exists?(ARGV[0])
puts "Usage: > ruby #{$0} filename"
exit(1)
end