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
var cache = [Int: Int]() | |
let queue = DispatchQueue(label: "cacheQueue", attributes: .concurrent) | |
let iterations = 100000 | |
// In the first run, cache is empty so we're writing each time | |
do { | |
let start = CFAbsoluteTimeGetCurrent() | |
for i in 0 ... iterations { | |
var exists = false | |
queue.sync { |
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
files: | |
"/etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
server { | |
listen 80; | |
gzip on; |
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
/*! | |
* Dynamically changing favicons with JavaScript | |
* Works in all A-grade browsers except Safari and Internet Explorer | |
* Demo: http://mathiasbynens.be/demo/dynamic-favicons | |
*/ | |
// HTML5™, baby! http://mathiasbynens.be/notes/document-head | |
document.head || (document.head = document.getElementsByTagName('head')[0]); | |
function changeFavicon(src) { |