This file contains 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
tell application "Terminal" | |
activate | |
do script "sudo get-shit-done work" | |
end tell |
This file contains 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
before(:each) do | |
@user = Factory(:user) | |
@media = Factory(:media) | |
@place = Factory(:hotel) | |
controller.stub!(:current_user).and_return(@user) | |
end | |
it "saves the newly uploaded image" do | |
# Force the media width and height to be nil | |
@media.width = nil |
This file contains 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
module CacheControl | |
extends self | |
def expire_cache_for(model, options = {}) | |
Rails.logger.debug "+++ CACHECONTROL - Expiring cache for #{model.class} #{model.id rescue nil} with options #{options.inspect}" | |
model_name = model.class.name | |
begin | |
invalidator_class = "CacheControl::#{model_name}".contantize | |
invalidator_class.invalidate_cache(model, option) | |
rescue Exception => e |
This file contains 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
# Hooks into ApplicationController's write_fragment method. | |
# write_fragment is used for action and fragment caching. | |
# Create an alias method chain to call our customer method | |
# which stores the associated key with the tag in a | |
# Redis Set. Then we can expire all those keys from anywhere | |
# in the code using Rails.cache.delete | |
# | |
# I use alias_method_chain instead of calling 'super' | |
# because there is a very rare case where someone | |
# may have redfined 'write_fragment' in their own |
This file contains 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
it "should write to cashier when I call Rails.cache.write with tags" do | |
cashier.should_receive(:store_fragment).with("foo", ["some_tag"]) | |
subject.write("foo", "bar", :tag => ["some_tag"]) | |
end |
This file contains 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
Resque::Server.use(Rack::Auth::Basic) do |user, password| | |
password == "some_password" | |
end |
This file contains 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
mount Resque::Server, :at => "/resque" |
This file contains 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
key('⌘+enter, ctrl+enter', function(e, h){ | |
input = $(e.target); | |
form = input.parents("form"); | |
form.submit(); | |
}); |
This file contains 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
function customKeyFilter(event) { | |
var tagName = (event.target || event.srcElement).tagName; | |
return (tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'); | |
} | |
key.filter = customKeyFilter; |
This file contains 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
Hi <recruiter name here>, | |
Thank you for your message. | |
At this point in time, I am not interested in any kind of full time position. | |
Sincerely, <your name here> | |
** I usually remove the contact details I usually have in the signature** |