Skip to content

Instantly share code, notes, and snippets.

View mvidner's full-sized avatar

Martin Vidner mvidner

  • SUSE
  • Prague, CZ, EU
View GitHub Profile
@mvidner
mvidner / anaselli-layout.ycp
Created February 26, 2014 09:42
replicate some C++ layout http://pastebin.com/7qJM2KN7 with YCP
// replicate some C++ layout http://pastebin.com/7qJM2KN7
// with YCP
{
UI::OpenDialog(
`VBox(
`HBox(
`HWeight(2,
`Frame(
"F1",
`HBox(
#!/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'])
#! /usr/bin/rspec
require_relative '../src/modules/IscsiLioData'
describe Yast::IscsiLioDataClass do
before :each do
@iscsilib = Yast::IscsiLioDataClass.new
@iscsilib.main()
@test_class = @iscsilib
#!/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 ' '}"
#! /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
#! /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)
# 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"
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 June 9, 2015 09:39
ruby whitespace is significant
def upcase_all(strings)
strings.map(&:upcase)
end
puts upcase_all (["You", "can", "use", "YOU"]).uniq
puts upcase_all(["You", "can", "use", "YOU"]).uniq
#! /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