Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Murden benmurden

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am benmurden on github.
  • I am benmurden (https://keybase.io/benmurden) on keybase.
  • I have a public key ASCNNISHijBy7IozdBOqmzbtjfRaCcX7HyspOxhUzKSQFwo

To claim this, I am signing this object:

@benmurden
benmurden / foo-bar-test.js
Created Sep 5, 2017
Fixed Ember.js component test
View foo-bar-test.js
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('foo-bar', 'Integration | Component | foo bar', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
View components.foo-bar.js
import Ember from 'ember';
import ClickOutside from '../mixins/click-outside';
const {
Component,
run,
on
} = Ember;
export default Component.extend(ClickOutside, {
@benmurden
benmurden / foo-bar-test.js
Created Sep 4, 2017
Example Ember.js component integration test
View foo-bar-test.js
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('foo-bar', 'Integration | Component | foo bar', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
@benmurden
benmurden / ember-each-1.12-helper.txt
Last active Sep 2, 2015
Ember.js 1.12 each deprecation RegEx helper
View ember-each-1.12-helper.txt
\{\{\s*#each ([a-zA-Z0-9]+) in ([a-zA-Z0-9]+)( itemController="[a-zA-Z0-9]+")?\s*\}\}
{{#each \2\3 as |\1|}}
## Or in vim
:%s/\{\{\s*#each ([a-zA-Z0-9]+) in ([a-zA-Z0-9]+)( itemController="[a-zA-Z0-9]+")?\s*\}\}/{{#each \2\3 as |\1|}}/g
@benmurden
benmurden / RegEx
Created Oct 1, 2014
RegEx for finding and namespacing CSS class uses in HTML.
View RegEx
class=(["a-z\-]*[" ]+)(class-to-find)([ "])
class=$1prefix-$2$3