Skip to content

Instantly share code, notes, and snippets.

View sega's full-sized avatar

Sebastian Gauck sega

View GitHub Profile
@sega
sega / duplicates.rb
Last active December 1, 2020 14:57
Remove duplicate files by content
#!/usr/bin/ruby
require 'digest'
require 'fileutils'
def paths
directories.map { |d| Dir.glob("#{d}/**/*") }.flatten.select { |p| File.file?(p) }
end
def directories
export PS1='\u@\h:\W$(__git_ps1 "[%s]") > '
# When I post the following to /api/send_money:
# | Recipient | Sebastian |
# | Amount | 7777 |
When /^I post the following to ([^:]+):$/ do |uri, fields|
# yes, i'd prefer to fold
params = {}
fields.rows_hash.each do |key, value|
params.merge!( { key => value } )
end