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 anaselli-layout.ycp
// replicate some C++ layout http://pastebin.com/7qJM2KN7
// with YCP
{
UI::OpenDialog(
`VBox(
`HBox(
`HWeight(2,
`Frame(
"F1",
`HBox(
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'])
View iscsi_lio_data_spec.rb
#! /usr/bin/rspec
require_relative '../src/modules/IscsiLioData'
describe Yast::IscsiLioDataClass do
before :each do
@iscsilib = Yast::IscsiLioDataClass.new
@iscsilib.main()
@test_class = @iscsilib
View y2paths.rb
#!/usr/bin/env ruby
BINDINGS_DIR = "../ruby-bindings"
rubylib = "#{BINDINGS_DIR}/src/ruby"
BASE_DIR = "../yast2"
BASE_LIBS = ["runlevel", "systemd", "network"]
y2dir = BASE_LIBS.map {|d| "#{BASE_DIR}/library/#{d}/src"}.join ":"
exec "Y2DIR=#{y2dir} RUBYLIB=#{rubylib} #{ARGV.join ' '}"
View y2logpids.pl
#! /usr/bin/perl
# http://en.opensuse.org/User:Mvidner
=head1 NAME
y2logpids - grep a YaST log file for process id changes and measure the time differences
=head1 SYNOPSIS
y2logpids -h|--help
View ui-without-y2base.rb
#! /usr/bin/env ruby
require "yast"
include Yast
include Yast::UIShortcuts
if Yast.ui_component == ""
Yast.ui_component = ARGV[0] || "ncurses"
end
Builtins.y2milestone("UI component: %1", Yast.ui_component)
View registration.pot
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR SuSE Linux Products GmbH, Nuernberg
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
View registration-without-comments.pot
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-02 14:53+0200\n"
"PO-Revision-Date: 2015-06-02 14:53+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
@mvidner
mvidner / call_whitespace.rb
Created Jun 9, 2015
ruby whitespace is significant
View call_whitespace.rb
def upcase_all(strings)
strings.map(&:upcase)
end
puts upcase_all (["You", "can", "use", "YOU"]).uniq
puts upcase_all(["You", "can", "use", "YOU"]).uniq
View forums.o.o-topposters.rb
#! /usr/bin/env ruby
# Scrape the user list of forums.opensuse.org to make a list of those
# who have posted at least LIMIT items, for use by the feed filter mentioned in
# http://mvidner.blogspot.com/2010/07/helping-newcomers.html
require "rubygems"
require "nokogiri"
require "open-uri"
LIMIT = 15
PERPAGE = 50
You can’t perform that action at this time.