Skip to content

Instantly share code, notes, and snippets.

Chris Manson mansona

Block or report user

Report or block mansona

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
html: `<div>
<img src="https://via.placeholder.com/350x150" width="350" height="150" alt="Placeholder" />
</div>`,
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appData : {
"title" : "First Title",
"subtitles": [
{
"AMount":"4343"
},
{
@mansona
mansona / adapters.application.js
Last active Sep 19, 2018
Ember Routing Issue
View adapters.application.js
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
host: 'http://localhost:3000/api'
});
View components.edit-instance.js
import Ember from 'ember';
export default Ember.Component.extend({
store: Ember.inject.service(),
router: Ember.inject.service(),
actions: {
createInstance() {
let newInstance = this.get('store').createRecord('instance');
this.set('instance', newInstance);
},
@mansona
mansona / controllers.application.js
Last active Apr 25, 2018
May I ask a Question - 001
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
filteredModel: Ember.computed('filterValue', 'model.@each.name', function() {
if(Ember.isEmpty(this.get('filterValue'))) {
return this.model;
}
return this.model.filter((test) => test.get('name') === this.get('filterValue'));
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Model Test',
model() {
return this.store.findAll('meetup')
}
});
View ember-working.js
// Version: v1.0.0-pre.2-291-g4785901
// Last commit: 4785901 (2013-01-05 18:57:16 +0100)
(function() {
/*global __fail__*/
/**
Ember Debug
View gist:4502560
// Version: v1.0.0-pre.2-291-g4785901
// Last commit: 4785901 (2013-01-05 18:57:16 +0100)
(function() {
/*global __fail__*/
/**
Ember Debug
@mansona
mansona / statusCodes.js
Created Dec 4, 2012
Mocha Zombie exception thrown on 401 status code
View statusCodes.js
var expect = require('expect.js'),
Browser = require('zombie');
var browser = new Browser({waitDuration: 1500});
describe('Status Codes', function(){
this.timeout(2000);
it('Unauthorized', function(done){
@mansona
mansona / app.js
Created Dec 3, 2012
Zombie Basic Example
View app.js
var zombie = require("zombie");
var assert = require("assert");
zombie.debug = true;
var browser = new zombie();
browser.visit("http://google.com/")
.then(function(){
assert.equal(browser.statusCode, 401);
You can’t perform that action at this time.