Skip to content

Instantly share code, notes, and snippets.

View ultimatemonty's full-sized avatar

Chris McCuller ultimatemonty

View GitHub Profile
@ultimatemonty
ultimatemonty / authenticator.js
Created February 26, 2015 18:22
Environment Config vars in an Ember globals app
App.SimpleAuthCredentialsAuthenticator = SimpleAuth.Authenticators.Base.extend({
setup: function () {
console.log(this.get('config')); // undefined
this.set('serverTokenEndpoint', this.get('config.api_servertokenendpoint')) // throws EX and poops out
}.on('init')
});
@ultimatemonty
ultimatemonty / mx-setting.hbs
Created March 31, 2015 19:35
mx-setting.js
<div class="col-md-4">
<dl class="dl-settings">
<dt>{{setting.name}}</dt>
<dd><em>{{setting.description}}</em></dd>
</dl>
</div>
<div class="col-md-2">
{{!-- {{x-toggle toggled=setting.value showLabels=true}} --}}
{{dynamic-component type=setting.valueType toggled=setting.value showLabels="true" toggle="toggle"}}
</div>
@ultimatemonty
ultimatemonty / AppHost.cs
Last active August 29, 2015 14:21
Custom Authentication
public override void Configure(Container container)
{
// other stuff omitted for brevity
// caching
container.Register<ICacheClient>(new MemoryCacheClient());
// Form based credentials authentication
this.Plugins.Add(new AuthFeature(() => new CustomAuthUserSession(),
new IAuthProvider[] {
// more providers can be added here as required
@ultimatemonty
ultimatemonty / application.controller.js
Last active September 9, 2015 13:38
SPIKE: Object Factory
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'SPIKE: Object Factory'
});
@ultimatemonty
ultimatemonty / application.controller.js
Last active November 24, 2015 14:42
Actions Testing
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@ultimatemonty
ultimatemonty / Requirements.md
Last active December 5, 2015 19:13
TODO App Ideas
  • combine the todo list with the calendar and notes
  • on a given day i can go back and see the todo list items i completed as well as any notes i made for that day and my todo list moves forward with me
  • so every day i see my up to date to do list
  • whenever i check something off the list it logs it as done on that day and removes it from my list
@ultimatemonty
ultimatemonty / index.js
Created July 24, 2016 17:28
importing blueprints pre Ember 2.x
var Blueprint = require('ember-cli/lib/models/blueprint');
var blueprints = [ 'route', 'route-test', 'component', 'component-test' ].map(function(name) {
return Blueprint.lookup(name);
});
/*jshint node:true*/
module.exports = {
description: 'Generates a glimmer-component style route',
beforeInstall: function(options) {
@ultimatemonty
ultimatemonty / question.txt
Created July 24, 2016 18:23
sugar pirate question
Right before your first Emberconf talk you blogged about your struggles with imposter syndrome. Since that first talk you've hit the bigtime within the Ember community - anytime you post something everyone is raving about it (and for good reason!). How has this popularity and praise affected your imposter syndrome?
// app/models/node.js
export default Model.extend({
sourceNodes: hasMany('node', { inverse: 'destinationNodes' }),
destinationNodes: hasMany('node', { inverse: 'sourceNodes' }),
destinationNodeOrder: attr('array') // custom transform, manually set in serializer
});