Skip to content

Instantly share code, notes, and snippets.

View testzugang's full-sized avatar

Meinhard Gredig testzugang

View GitHub Profile
require 'net/dav'
class WebDavWorker
attr_reader :uri, :username, :password, :errors
attr_accessor :connection
def self.connect_to_uri uri, username, password
worker = WebDavWorker.new(uri, username, password)
@testzugang
testzugang / opposite_uniq
Last active December 16, 2015 02:59
If in need for the opposite of "uniq" get only the duplicated entries in an array.
duplicate_keys = []
all_keys.uniq.each do |k|
count = all_keys.count(k)
duplicate_keys << k if count > 1
end