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
| function append(separator) { | |
| return typeof separator === "string" ? appender(separator, "") : appender("", "").apply(this, arguments); | |
| } | |
| function appender(separator, s) { | |
| return function tag(literalParts, ...computedParts) { | |
| s += literalParts[0]; | |
| for (let i = 1; i < literalParts.length; ++i) { | |
| s += computedParts[i - 1] + literalParts[i]; | |
| } |
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
| // Stick all your icons in a subfolder in your images folder. Put retina versions in a subfolder of that called "@2x". | |
| $sprites: sprite-map("NAME_OF_SUBFOLDER/*.png"); | |
| $sprites2x: sprite-map("NAME_OF_SUBFOLDER/@2x/*.png"); | |
| // stolen from 37signals | |
| @mixin retina-media() { | |
| @media (min--moz-device-pixel-ratio: 1.3), | |
| (-webkit-min-device-pixel-ratio: 1.3), | |
| (min-device-pixel-ratio: 1.3), | |
| (min-resolution: 1.3dppx) { |
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
| Latency Comparison Numbers (~2012 except when noted) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |