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
save-exact = true # Saves exact version without needing --save-exact. |
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
if defined?(ActiveRecord::Base) && defined?(Authlogic) | |
controller = ApplicationController.new | |
require 'action_controller/test_case' | |
controller.instance_variable_set(:@_request, ActionController::TestRequest.new) | |
controller.instance_variable_set(:@_response, ActionController::TestResponse.new) | |
Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(controller) | |
end | |
UserSession.new( User.first ) |
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
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): |
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
cd ~/Library/Containers && du -h -d 0 *airmail* |
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
Show hidden characters
[ | |
{ | |
"keys": ["shift+space"], | |
"command": "exit_insert_mode", | |
"context": [ | |
{ "key": "setting.command_mode", "operand": false }, | |
{ "key": "setting.is_widget", "operand": false } | |
] | |
} | |
] |
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
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 |
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
100 = :continue | |
101 = :switching_protocols | |
102 = :processing | |
200 = :ok | |
201 = :created | |
202 = :accepted | |
203 = :non_authoritative_information | |
204 = :no_content | |
205 = :reset_content | |
206 = :partial_content |
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
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"] |
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
VIDEO_FILE_EXTENSIONS = ['.264', | |
'.3g2', | |
'.3gp', | |
'.3gp2', | |
'.3gpp', | |
'.3gpp2', | |
'.3mm', | |
'.3p2', | |
'.60d', | |
'.787', |
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
class String | |
def symbolize_with_care *args | |
valid_values = args | |
valid_values.each do |v| | |
if v.to_s == self | |
return v | |
break | |
end | |
end |
NewerOlder