Skip to content

Instantly share code, notes, and snippets.

@cheald
Created November 7, 2012 18:39
Show Gist options
  • Save cheald/4033495 to your computer and use it in GitHub Desktop.
Save cheald/4033495 to your computer and use it in GitHub Desktop.
ASSET_HOSTS = ["https://da950294alksdjfa.cloudfront.net", "https://sa9dfasd0fa9sd.cloudfront.net"]
config.action_controller.asset_host = Proc.new {|source, request = nil, *_|
index = Digest::SHA1.digest(source)[0].ord % ASSET_HOSTS.length
ASSET_HOSTS[index]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment