Skip to content

Instantly share code, notes, and snippets.

View joshuapinter's full-sized avatar
🎯
Focusing

Joshua Pinter joshuapinter

🎯
Focusing
View GitHub Profile
Hey Jeff,
Nope, don’t work for Airmail. Just a fan and an avid (recently annoyed) user. :)
Unfortunately, it will have to redownload everything again. But there are zero performance issues so it’s worth it. It just hums away in the background without clogging up the machine.
One thing of note that I discovered is how much storage is being used for these local caches, AND when you download the beta it effectively doubles that storage as it keeps the beta messages in a different directory.
To check on the use of these local cache directories, you can run the following command from Terminal (Use Spotlight to find it if you’re not sure):
@joshuapinter
joshuapinter / merge_nicely.rb
Last active August 29, 2015 14:06
Merge Nicely
class Hash
# Merges attributes nicely instead of just overwriting them.
#
# { class: 'large' }.merge_nicely!( class: 'label' ) #=> { class: 'large label' }
#
def merge_nicely!( hash_to_add = {} )
self.merge!(hash_to_add.to_hash) do |key, original_element, new_element|
if original_element.is_a? String and new_element.is_a? String
original_element + " " + new_element
@joshuapinter
joshuapinter / zencoder.rake
Created June 26, 2014 23:18
Check Your Zencoder Balance So You Don't Go Over.
MINUTES_ALLOWED = 1000
PRICE_PER_MINUTE = 0.05
namespace :zencoder do
desc "Check if Zencoder balance is above #{MINUTES_ALLOWED} minutes / $#{MINUTES_ALLOWED * PRICE_PER_MINUTE}."
task :check_balance => :environment do
minutes_used = Zencoder::Account.details.body["minutes_used"]