Created
January 3, 2023 18:34
-
-
Save imme5150/531f0c34cb58246699217e223f9563cb to your computer and use it in GitHub Desktop.
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
require 'set' | |
# copy a string to the clipboard | |
def cp(string = IRB.CurrentContext.last_value) | |
IO.popen('xclip -sel clip', 'w') { |f| f << string.to_s } | |
string | |
end | |
if ARGV[0] && ARGV[0][0].downcase == 't' | |
@lines = "".split("\n") | |
elsif ARGV[0] && ARGV[0][0].downcase == 'c' | |
@lines = `xclip -o`.split("\n") | |
else | |
@lines = File.readlines("/home/shup/Desktop/input.txt").map &:chomp | |
end | |
# @lines = @lines.first.split(',') | |
# @lines = @lines.map(&:to_i) | |
c = 0 | |
@lines.each_with_index do |l, row| | |
end | |
puts cp c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment