Skip to content

Instantly share code, notes, and snippets.

View mlh758's full-sized avatar

Michael Harris mlh758

  • Fountain
  • Kansas City
  • 20:43 (UTC -05:00)
View GitHub Profile
@repodevs
repodevs / macOS.sh
Created December 12, 2018 14:56
gpg: signing failed: Inappropriate ioctl for device macOS
❱ git config user.signingKey 38AF394C
❱ git config commit.gpgSign true
echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
test
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device
@aquajach
aquajach / protected_zipped_csv_json.rb
Last active May 25, 2024 10:32
Password protected zip file with csv/json data inside
compressed_filestream = Zip::OutputStream.write_buffer(::StringIO.new(''), Zip::TraditionalEncrypter.new('password')) do |zos|
#First file
zos.put_next_entry "test1.csv"
csv = CSV.generate do |csv|
User.all.each do |user|
csv << [user.id, user.name]
end
csv << values
end
zos.print csv
@wgb
wgb / gist:7431a00f2ac1f96b595e
Last active August 29, 2015 14:07
Expression Parser
(require '[clojure.string :as str])
;; In this use case, a valid expression won't have an even number of lexemes
(defn valid-length? [lexemes]
(odd? (count lexemes)))
(defn valid-paren-count? [lexemes]
(let [opens (filter #(= "(" %) lexemes)
closes (filter #(= ")" %) lexemes)]
(= (count opens) (count closes))))