-
cd ~/.ssl
-
Generate new .key and .crt file
# SEE: https://github.com/webpack/webpack-dev-server/issues/854#issuecomment-292445914
openssl req \
-newkey rsa:2048 \
-x509 \
import Ember from 'ember'; | |
const { | |
get, | |
set | |
} = Ember; | |
export default Ember.Controller.extend({ | |
actions: { | |
updateSsn(event) { |
import Service from '@ember/service'; | |
import { get } from '@ember/object'; | |
import { equal } from '@ember/object/computed'; | |
import config from '../config/environment'; | |
export default Service.extend({ | |
unknownProperty(path) { | |
return get(config, path); | |
}, |
cd ~/.ssl
Generate new .key and .crt file
# SEE: https://github.com/webpack/webpack-dev-server/issues/854#issuecomment-292445914
openssl req \
-newkey rsa:2048 \
-x509 \
/* | |
'plugin:prettier/recommended' does the following: | |
extends: ['prettier'], | |
plugins: ['prettier'], | |
rules: { | |
'prettier/prettier': 'error' | |
} | |
*/ | |
module.exports = { |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
#!/bin/sh | |
# | |
# Purge the CloudFlare cache after pushing an update to a Github Repo branch | |
# | |
# To use, rename this file to "post-receive" and drop it into the `.git/hooks/` directory in your project's root. | |
# Change the $branch value based on the type of page you're deploying. | |
# EX: Use "master" for Organization Pages, and "gh-pages" for Project Pages. | |
# | |
# Find your CloudFlare API token here: https://www.cloudflare.com/a/profile |
This is a ServiceWorker template to turn small github pages into offline ready app.
Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html
file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js
files). I wanted to cache these files so that I can access my tools offline as well.
Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS
of your repository.
// Re: busting the cache when using service worker | |
// The service worker JS name isn't fingerprinted, so if it has cache headers, it won't be updated and then none of your | |
// assets will be updated (because they're cached by the service worker for offline access). This is one technique for | |
// caching headers to ensure you're only caching fingerprinted assets | |
<VirtualHost *:8080> | |
ServerAdmin [email protected] | |
DocumentRoot "/Users/martndemus/Projects/DockYard/smart-shopping-list/dist" | |
ServerName localhost |
assert.async();
This assert.asyncThrows
custom assertion allows us to write tests against failing async code, usually as a result of a server error (4xx/5xx response).
test('If the index route errors, I see a message', async function(assert) {
server.create('post');
server.get('/posts/:id', { errors: ['The site is down'] }, 500); // force Mirage to error
await assert.asyncThrows(() => {
return visit('/posts/1');
}, 'GET /posts/1 returned a 500');