This file contains hidden or 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
rbx-2.0.0-dev | |
Running with rubinius 2.0.0dev (1.9.3 9ad741f3 yyyy-mm-dd JI) [i686-pc-linux-gnu] | |
* A binary packet | |
ASCII-8BIT: � ("\xFF") 1 bytes | |
* Aligning before appending more data, with String#ljust | |
US-ASCII: � ("\xFF\x00\x00\x00") 4 bytes | |
* More data | |
ASCII-8BIT: � ("\xEE") 1 bytes | |
* Putting them together with String#+ | |
An exception occurred running rbx-encoding-ljust.rb |
This file contains hidden or 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
rbx-2.0.0-dev | |
Running with rubinius 2.0.0dev (1.9.3 9ad741f3 yyyy-mm-dd JI) [i686-pc-linux-gnu] | |
* A binary packet | |
ASCII-8BIT: � ("\xFF") 1 bytes | |
* A unicode string | |
UTF-8: Václav Havel ("V\xC3\xA1clav Havel") 13 bytes | |
* Plan B | |
** Adding NUL | |
UTF-8: Václav Havel ("V\xC3\xA1clav Havel\x00") 14 bytes | |
** Forcing 8-bit |
This file contains hidden or 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 'rubygems' | |
require 'fog' | |
%w{OS_PASSWORD OS_USERNAME OS_AUTH_URL}.each do |env| | |
if ENV[env].nil? | |
$stderr.puts "Missing #{env} environment variable." | |
exit 1 | |
end |
This file contains hidden or 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 | |
# Ruby Variables and Constants | |
module M | |
variable = 1 | |
CONSTANT = 2 | |
variable = 3 | |
# IMMUTABILITY is not guaranteed |
This file contains hidden or 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 'rubygems' | |
require 'dbus' | |
b = DBus.session_bus | |
ps = b.service 'org.PulseAudio1' | |
po = ps.object '/org/pulseaudio/server_lookup1' | |
po.introspect | |
pi = po['org.PulseAudio.ServerLookup1'] | |
a = pi['Address'] | |
path = a.split('=').last |
This file contains hidden or 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
BOOTPROTO='dhcp' | |
STARTMODE='auto' |
This file contains hidden or 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/sh | |
echo "1..2" | |
YASTCLI=/sbin/yast2 | |
##### | |
newhn=atestinghostname | |
$YASTCLI dns edit hostname=$newhn |
This file contains hidden or 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 | |
$deps = { | |
:network => [ :foo, :bar, :baz], | |
:foo => [:testsuite, :yast2], | |
:bar => [:yast2, :testsuite], | |
:baz => [:yast2, :testsuite], | |
:yast2 => [:testsuite], | |
:testsuite => [] | |
} |
This file contains hidden or 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 "Intermediate"; | |
import "Modelist"; | |
global void Hello() { | |
Modelist::Hello(); | |
} | |
} |
This file contains hidden or 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
// https://github.com/yast/yast-ruby-bindings/issues/23 | |
// Y2DEBUG=1 /usr/lib/YaST2/bin/y2base -l - ~/snippets/dummy-location.ycp UI |& grep SECRET | |
{ | |
term dummy_data = `DataMap($[], $[], $[], "DEFAULT"); | |
// YCP: | |
// [agent-dummy] snippets/dummy-location.ycp:8 LOGTHIS_SECRET_314 Read .target.bash "ls" "DEFAULT" | |
// RB: | |
// [agent-dummy] :0 LOGTHIS_SECRET_314 Read .target.bash "ls" "DEFAULT" | |
SCR::RegisterAgent (.dummy, `ag_dummy(dummy_data)); | |
any a = SCR::Read (.dummy.target.bash, "ls"); |