Skip to content

Instantly share code, notes, and snippets.

View jeremysmithco's full-sized avatar

Jeremy Smith jeremysmithco

View GitHub Profile
@jeremysmithco
jeremysmithco / mails
Created May 20, 2021 13:46
Rails bin script to listen for emails delivered to filesystem and open with Mail (on a Mac)
#!/usr/bin/env ruby
require 'listen'
APP_ROOT = File.expand_path('..', __dir__)
listener = Listen.to("#{APP_ROOT}/tmp/mails") do |_modified, added, _removed|
added.each do |added_file|
if added_file.end_with?(".eml")
system("open -a Mail #{added_file}")
else

Keybase proof

I hereby claim:

  • I am bentoncreation on github.
  • I am bentoncreation (https://keybase.io/bentoncreation) on keybase.
  • I have a public key whose fingerprint is 69F3 3662 82F5 6128 4016 61FD 93C3 7BCB 2202 47A5

To claim this, I am signing this object:

@jeremysmithco
jeremysmithco / word_counter.rb
Last active August 29, 2015 14:06
Count words in your Rails app, just pass it the path to your views directory (or a subdirectory) to get the word count from your ERB files.
#!/usr/bin/env ruby
require "action_view"
require "fileutils"
class WordCounter
include ActionView::Helpers::SanitizeHelper
def initialize(initial_directory)
@initial_directory = initial_directory
puts count_directory(@initial_directory)
screencapture 1.png; sips --resampleWidth 225 1.png