Skip to content

Instantly share code, notes, and snippets.

@planetcrypton
planetcrypton / text-2-html-test.js
Last active February 22, 2016 08:55
Ember JS Helper for converting parts of a text (non-mark-down) to HTML whenever certain patterns are recognized
/**
* $ ember test --filter "text-2-html"
*/
import { text2Html } from '../../../helpers/text-2-html';
import { module, test } from 'qunit';
module('Unit | Helper | text 2 html');
const input = "Hey\nHow're ya doin'?\nSorry you can't get through.\nWhy don't you leave me your name, mine is @planetcrypton, and your number, mine is +4512345678, and I'll get back to you.\nDon't forget to visit http://www.wearedelasoul.com/\nMail me at plug2@reversed-yogurt.com #oldschool #plug1 #plug2 #plug3";
@planetcrypton
planetcrypton / validation.js
Last active January 2, 2016 16:41
Really simple model-validation for Ember.JS (ember-cli), by extending a model with extra validation functionality. Put this file in your models directory and read the instruction in the comment
/**
* Really simple model-validation
* by extending a model with
* extra validation functionality
*
* Here's how it works
* /your-app/models/person.js:
* import DS from 'ember-data';
* import Validation from 'your-app/models/validation';
*