Skip to content

Instantly share code, notes, and snippets.

/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
import { Ability } from 'ember-can';
import computed from 'ember-computed';
export default Ability.extend({
canShow: computed('model.show', function() {
return this.get('model.show');
})
});
import { Ability } from 'ember-can';
import computed from 'ember-computed';
export default Ability.extend({
canShow: computed('model.show', function() {
return this.get('model.show');
})
});
@kketch
kketch / throwing-an-error-with-fortune.js
Created December 9, 2016 09:56
Throwing an error with fortune test
const fortune = require('fortune')
const fortuneHTTP = require('fortune-http')
const { errors: { BadRequestError } } = fortune
function input(context, record) {
switch (context.request.method) {
case 'create':
return record
case 'update':
throw new BadRequestError('Invalid status')