- http://blog.lholmquist.org/service-workers-can-settle-conflicts-too/
- https://hacks.mozilla.org/2015/11/offline-service-workers/
- https://github.com/suissa/angularjs-service-worker/blob/master/app/view1/view1.js
- https://raw.githubusercontent.com/HubSpot/offline/v0.7.13/offline.min.js
- https://github.com/origin1tech/jspm-angular-seed
- https://raw.githubusercontent.com/chriscoyier/Simple-Offline-Site/master/js/service-worker.js
- https://github.com/WICG/BackgroundSync/blob/master/demo/sw.js
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 nestCollection(model, attributeName, nestedCollection) { | |
| //setup nested references | |
| for (var i = 0; i < nestedCollection.length; i++) { | |
| model.attributes[attributeName][i] = nestedCollection.at(i).attributes; | |
| } | |
| //create empty arrays if none | |
| nestedCollection.bind('add', function (initiative) { | |
| if (!model.get(attributeName)) { | |
| model.attributes[attributeName] = []; |
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
| /** | |
| * Enable route to __noSuchMethod__ when unknown method calling. | |
| * | |
| * @param {Object} obj Target object. | |
| * @return {Object} | |
| */ | |
| function enableMethodMissing(obj) { | |
| var functionHandler = createBaseHandler({}); | |
| functionHandler.get = function(receiver, name) { |
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
| /* | |
| Polyfill for the Object.watch/Object.unwatch functions available in Mozilla browsers | |
| https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/watch | |
| you have a test here: | |
| http://www.telecable.es/personales/covam1/deployToNenyures/SourceCode/Object.watch.test.js | |
| and can read more here: | |
| http://deploytonenyures.blogspot.com.es/2013/02/objectwatch-polyfill.html | |
| */ |
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
| // http://stackoverflow.com/questions/15829172/stop-chrome-back-forward-two-finger-swipe | |
| $(document).on('mousewheel', function(e) { | |
| var $target = $(e.target).closest('.scrollable-h'); | |
| if ($target.scrollLeft () <= 4) { | |
| $target.scrollLeft(5); | |
| return false; | |
| } | |
| }); | |
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
| export default DS.Adapter.extend({ | |
| orbitSource: undefined, | |
| init: function() { | |
| this._super(); | |
| Orbit.Promise = Ember.RSVP.Promise; | |
| // TODO - autogenerate schema from DS models | |
| var schema = { | |
| idField: 'id', |
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
| var httpResponseQueue = Ember.A(); | |
| var checkQueueInterval = null; | |
| var checkQueue = function() { | |
| for (var i = 0; i < httpResponseQueue.length; i++) { | |
| var queuedItem = httpResponseQueue[i]; | |
| var found = fakehr.match(queuedItem.verb.toUpperCase(), queuedItem.url); | |
| if (found) { | |
| found.respond(queuedItem.status || 200, {'content-type': 'application/json'}, queuedItem.body); |
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
| #!/bin/sh | |
| # PATH TO YOUR HOSTS FILE | |
| ETC_HOSTS=/etc/hosts | |
| # DEFAULT IP FOR HOSTNAME | |
| IP="127.0.0.1" | |
| # Hostname to add/remove. | |
| HOSTNAME=$1 |
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
| [ | |
| { | |
| "name": "Alberta", | |
| "abbreviation": "AB" | |
| }, | |
| { | |
| "name": "British Columbia", | |
| "abbreviation": "BC" | |
| }, | |
| { |
⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates
What this will cover
- Host a static website at S3
- Redirect
www.website.comtowebsite.com - Website can be an SPA (requiring all requests to return
index.html) - Free AWS SSL certs
- Deployment with CDN invalidation
OlderNewer