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 | |
# 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 |
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 | |
# in ruby 1.8, Enumerator is limited | |
require 'generator' | |
# 1234 -> [1, 2, 3, 4] | |
# but don't use a String | |
def digits(i, base = 10) | |
g = Generator.new do |g| | |
begin |
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 perl | |
use strict; | |
use warnings; | |
use Test::Simple tests => 2 * 9; | |
use List::Util qw(first); | |
# In a space separated list of flags, set one flag on or off (add or delete it). | |
# Don't modify the list unnecessarily. | |
sub set_flag { |
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 | |
$data = IO.read(ARGV[0], 0x2400) | |
def check_contents_at(offset, contents, description) | |
size = contents.bytesize | |
raise "#{description} not found at offset #{offset}" unless $data[offset, size] == contents | |
end | |
EXIF_ORIENTATION = "\x12\x01\x03\x00\x01\x00\x00\x00" |
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 | |
# Convert ancient YCP syntax: | |
# define TYPE NAME(ARGS) ``{ BODY } | |
# becomes | |
# TYPE NAME(ARGS) { BODY } | |
# | |
# usage: $0 foo.ycp | |
# or | |
# cd tree_to_find_ycp_in; $0 | |
FINDARGS="-name *.ycp" |
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
diff --git a/.functests b/.functests | |
index 86abce3..7b5aa2b 100755 | |
--- a/.functests | |
+++ b/.functests | |
@@ -1,4 +1,5 @@ | |
#!/bin/bash | |
+set -e | |
nosetests test/functional --exe | |
nosetests test/functionalnosetests --exe |
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/expect | |
# usage: ssh-password mysecret command... | |
# where command is ssh user@machine | |
# or ssh-copy-id user@machine | |
# ... | |
match_max 100000 | |
set timeout -1 | |
set password [lrange $argv 0 0] | |
spawn {*}[lrange $argv 1 end] | |
# Look for passwod prompt |
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
CFLAGS=`pkg-config --cflags dbus-1` -Wall | |
LDFLAGS=`pkg-config --libs dbus-1` | |
all: dbus-example |
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 with 255.chr | |
ASCII-8BIT: � ("\xFF") 1 bytes | |
* A binary packet with "\xEE" | |
US-ASCII: � ("\xEE") 1 bytes | |
* Putting them together with String#+ | |
An exception occurred running rbx-encoding-backslash-x.rb | |
undefined conversion for '"\xFF"' from ASCII-8BIT to US-ASCII (Rubinius::EncodingClass::Encoding::CompatibilityError) |
OlderNewer