Skip to content

Instantly share code, notes, and snippets.

David Negstad dnegstad

Block or report user

Report or block dnegstad

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 keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@dnegstad
dnegstad / user-data-consul-server
Created Jan 26, 2016 — forked from bdclark/user-data-consul-server
CoreOS cloud-config to bootstrap consul cluster
View user-data-consul-server
#cloud-config
coreos:
etcd2:
# generate a token from https://discovery.etcd.io/new?size=3
discovery: https://discovery.etcd.io/<token>
advertise-client-urls: http://$private_ipv4:2379
initial-advertise-peer-urls: http://$private_ipv4:2380
listen-client-urls: http://0.0.0.0:2379
listen-peer-urls: http://$private_ipv4:2380
@dnegstad
dnegstad / polymorphic-mixin.js
Created Mar 20, 2015
Ember Polymorphic Serialization
View polymorphic-mixin.js
import Ember from 'ember';
export default Ember.Mixin.create({
normalize: function(type, hash, prop) {
if (hash.type) {
let typeKey = this.typeForRoot(hash.type);
let newType = this.store.modelFor(typeKey);
if (newType) {
type = newType;
}
@dnegstad
dnegstad / initializer
Created Dec 9, 2014
Keeping link-to from blowing up with webcomponent.js polyfills
View initializer
import Ember from 'ember';
Ember.LinkView.reopen({
layoutName: 'components/link-view'
});
export default {
name: 'link-to',
initialize: function() {}
};
@dnegstad
dnegstad / application.js
Created Nov 21, 2014
Read only attributes in Ember Data
View application.js
import DS from 'ember-data';
DS.ActiveModelSerializer.extend({
serializeAttribute: function(record, json, key, attribute) {
if (attribute.options && attribute.options.readOnly) {
return;
} else {
this._super.apply(this, arguments);
}
}
@dnegstad
dnegstad / application.js
Created Nov 21, 2014
Shallow nested route Ember Data adapter
View application.js
import DS from 'ember-data';
export default DS.ActiveModelAdapter.extend({
buildURL: function(type, id, record) {
if (id) {
return this._super.apply(this, arguments);
}
var parent = this.get('parent');
var path = [];
@dnegstad
dnegstad / Brocfile.js
Last active Jan 2, 2019
Polymer WebComponents in ember-cli >= 0.0.41
View Brocfile.js
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var vulcanize = require('broccoli-vulcanize');
var app = new EmberApp();
var polymerVulcanize = vulcanize('app', {
input: 'elements.html',
output: 'assets/vulcanized.html',
You can’t perform that action at this time.