Skip to content

Instantly share code, notes, and snippets.

View DingoEatingFuzz's full-sized avatar
💻
As you already know, computers

Michael Lange DingoEatingFuzz

💻
As you already know, computers
View GitHub Profile
@DingoEatingFuzz
DingoEatingFuzz / _avatar-source.scss
Created November 1, 2022 17:39
New Avatar Source Component
.avatar-source {
float: left;
margin-right: 20px;
padding-top: 3px;
position: relative;
width: 36px;
height: 36px;
img {
height: 36px;
import Component from '@glimmer/component';
export default class extends Component {
}
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@DingoEatingFuzz
DingoEatingFuzz / docker-compose.yml
Created August 11, 2020 07:21
Running the Nomad Prototype UI with an NGINX Proxy to get around CORS
version: '3.8'
services:
ui:
image: dingoeatingfuzz/nomad-prototype-ui:latest
ports:
- '6464:6464'
environment:
NOMAD_API: 'http://localhost:8080'
nginx:
image: nginx:latest
@DingoEatingFuzz
DingoEatingFuzz / controllers.application\.js
Last active April 25, 2020 20:56
alias-404-double-load
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
export default Controller.extend({
appName: 'Ember Twiddle',
filterOne: computed('model.[]', 'model.@each.parent', function() {
return this.model.compact().filter(m => {
m.get('parent');
@DingoEatingFuzz
DingoEatingFuzz / main.rs
Created April 3, 2019 16:16
Nomad Community Call Wave Dem
use std::{thread, time};
use std::collections::LinkedList;
use std::f32;
use rand::random;
fn main() {
let two_pi = f32::consts::PI * 2.0;
let wait_duration = time::Duration::from_millis(500);
// Length of the list when wave as at 0
@DingoEatingFuzz
DingoEatingFuzz / ed-duplicate-id.md
Last active April 4, 2018 18:39
Ember Data duplicate record in hasMany bug report

Duplicate Records make it into the store

This occurs in Nomad UI, an open source ember app: https://github.com/hashicorp/nomad/tree/master/ui

Summary

Fetching related data in the right order under unknown circumstances will push a copy of an existing record instead of updating the existing record.

Steps to Reproduce

import Ember from 'ember';
export default Ember.Component.extend({
items: [],
actions: {
addItem(item) {
this.get('items').pushObject(item);
},
}
@DingoEatingFuzz
DingoEatingFuzz / controllers.application.js
Created July 20, 2017 17:16
Computed Property Caching
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
defaultItem: 'foo',
item: Ember.computed(function() {
return this.get('defaultItem')
}),
@DingoEatingFuzz
DingoEatingFuzz / controllers.application.js
Created April 13, 2017 20:22
Tours Data Structure Proposal
import Ember from 'ember';
import Tour from '../tour-model';
const { inject } = Ember;
export default Ember.Controller.extend({
personalization: inject.service(),
campaignTour: null,