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
def deep_values(h, acc = []) | |
return [nil] if h.nil? | |
case h | |
when Hash | |
return deep_values(h.values) | |
when Array | |
acc.push(*h.map { |v| deep_values(v) }) | |
else | |
acc.push(h) | |
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 bash | |
remove() { | |
entry="$1" | |
echo -ne "Removing $entry [" | |
sudo rm -rf "$entry" | |
if [[ ! -e "$entry" ]]; then | |
echo -ne "OK" | |
else |
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 'pdf-reader' | |
wordsToFind = ARGV | |
Dir.entries(".").select { |f| File.file?(File.join(".", f)) && File.extname(f) == ".pdf"}.each { |file| | |
puts file | |
pReader = PDF::Reader.new(file) |
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 'open-uri' | |
def download_image(url, dest) | |
open(url) do |u| | |
File.open(dest, "wb") { |f| f.write(u.read)} | |
end | |
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
require 'open-uri' | |
def download_image(url, dest) | |
open(url) do |u| | |
File.open(dest, "wb") { |f| f.write(u.read)} | |
end | |
end | |
files = [] |