Skip to content

Instantly share code, notes, and snippets.

Martin Vidner mvidner

  • SUSE
  • Prague, CZ, EU
Block or report user

Report or block mvidner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View native-ruby-ops.diff
This file has been truncated, but you can view the full file.
diff -ur result/add-on/src/include/add-on/add-on-workflow.rb result-bck/add-on/src/include/add-on/add-on-workflow.rb
--- result/add-on/src/include/add-on/add-on-workflow.rb 2013-06-28 13:55:14.924000000 +0200
+++ result-bck/add-on/src/include/add-on/add-on-workflow.rb 2013-06-28 12:36:25.828000000 +0200
@@ -948,8 +948,13 @@
PushButton(Id(:packager), _("Run &Software Manager..."))
- _("<p>All add-on products installed on your system are displayed.</p>") + _(
- "<p>Click <b>Add</b> to add a new add-on product, or <b>Delete</b> to remove an add-on which is in use.</p>"
View ag_tty.diff
--- /usr/lib/YaST2/servers_non_y2/ag_tty.orig 2013-07-02 12:06:35.250848656 +0200
+++ /usr/lib/YaST2/servers_non_y2/ag_tty 2013-07-02 12:07:19.303495394 +0200
@@ -145,7 +145,7 @@
if ($path eq ".")
- ReadString($term, $prompt);
+ ycp::Return ( [ "I am a byteblock" ], 0 );
elsif ($path eq ".nohistory")
mvidner / gist:6451197
Last active Dec 22, 2015
Ruby: .method vs ::constant
View gist:6451197
mvidner@mrakoplas:~$ irb
irb(main):001:0> require 'yast'
<internal:prelude>:18: warning: already initialized constant MUTEX_FOR_THREAD_EXCLUSIVE
=> true
irb(main):003:0> Yast.import "Label"
=> nil
irb(main):006:0> Yast::Label.AddButton
=> "&Add"
irb(main):007:0> Yast::Label::AddButton
TypeError: #<Yast::LabelClass:0x00000002742000 @my_textdomain="base"> is not a class/module
// g++ -std=c++11 $(pkg-config --cflags --libs libyui) -o a.out
#include "YUI.h"
#include "YWidgetFactory.h"
#include "YDialog.h"
#include "YLayoutBox.h"
#include "YSpacing.h"
#include "YLabel.h"
#include "YPushButton.h"
mvidner / diff-mst.rb
Created Dec 6, 2013
Assist in finding a minimal spanning tree of diffs among 4 files
View diff-mst.rb
#!/usr/bin/env ruby
filenames = ARGV
# hardcoded for 4 vertices
def all_pairs(v)
[v[0], v[1]],
[v[0], v[2]],
[v[0], v[3]],
mvidner / test-ui.rb
Created Dec 6, 2013
non interactive test that yast does not crash when we update some parts of libyui
View test-ui.rb
module Yast
class TestUIClient < Client
def main
Yast.import "Wizard"
View rake-prereqs-dot
#!/usr/bin/env ruby
# Usage: rake -P | rake-prereqs-dot | dotty -
# Convert the output of `rake -P/--prereqs`
# ("Display the tasks and dependencies, then exit.")
# to a graphviz graph
# Sample input
# -8<-
mvidner / sendkeys
Last active Oct 4, 2019
Translate a string to "sendkey" commands for QEMU.
View sendkeys
#!/usr/bin/env ruby
# Translate a string to "sendkey" commands for QEMU.
# Martin Vidner, MIT License
# sendkey keys
# You can emulate keyboard events through sendkey command. The syntax is: sendkey keys. To get a list of keys, type sendkey [tab]. Examples:
# sendkey a
View anaselli-layout.ycp
// replicate some C++ layout
// with YCP
View ay_test.rb
#!/usr/bin/env rspec
ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
require "yast"
require "pp"
def clone(auto_client)
Yast::WFM.CallFunction(auto_client, ['Read'])
Yast::WFM.CallFunction(auto_client, ['SetModified'])
You can’t perform that action at this time.