If you're shipping iOS apps,
and dream of the bucks you'll make,
you might think of "going native",
but Xcode's a big headache.
| /* eslint-disable unicorn/no-null */ | |
| /* | |
| * Resetting window.location between tests is unfortunately a hard topic with JSDOM. | |
| * | |
| * https://gist.github.com/tkrotoff/52f4a29e919445d6e97f9a9e44ada449 | |
| * | |
| * FIXME JSDOM leaves the history in place after every test, so the history will be dirty. | |
| * Also its implementations for window.location and window.history are lacking. | |
| * - https://github.com/jsdom/jsdom/blob/22.1.0/lib/jsdom/living/window/Location-impl.js |
| // ******************* | |
| // Contributors: | |
| // - Andrew Smith (@AndrewSouthpaw) | |
| // - Shaun Mosley (@Shaunm44) | |
| // ******************* | |
| // This setup will allow you to synchronize personal events from one calendar (the "secondary calendar") | |
| // to another calendar, e.g. work (the "primary calendar"), but obfuscate the details. Then your coworkers | |
| // know when you're busy but don't get to see the personal details. | |
| // |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| 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 |
| { | |
| // -------------------------------------------------------------------- | |
| // JSHint Configuration, Strict Edition | |
| // -------------------------------------------------------------------- | |
| // | |
| // This is a options template for [JSHint][1], using [JSHint example][2] | |
| // and [Ory Band's example][3] as basis and setting config values to | |
| // be most strict: | |
| // | |
| // * set all enforcing options to true |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| var LiveCollection = (function (_, Backbone) { | |
| var Collection = Backbone.Collection; | |
| // Define a Backbone Collection handling the details of running a "live" | |
| // collection. Live collections are expected to handle fetching their own | |
| // data, rather than being composed from separate models. | |
| // They typically add new models instead of resetting the collection. | |
| // A custom add comparison makes sure that duplicate models are not | |
| // added. End result: only new elements will be added, instead | |
| // of redrawing the whole collection. | |
| // |