Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Beale mixonic

View GitHub Profile
@mixonic
mixonic / readme.md
Last active Apr 21, 2021
Services for Glimmer.js
View readme.md

Setup

In config/environment.js:

// config/environment.js
'use strict';

/*
 * Mostly this is the stock module config.
@mixonic
mixonic / server.js
Created Apr 28, 2011
Node.js + Socket.io + Bash. A collaborative terminal for your browser.
View server.js
//
// This server will start a bash shell and expose it
// over socket.io to a browser. See ./term.html for the
// client side.
//
// You should probably:
//
// npm install socket.io
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js
//
@mixonic
mixonic / .gitignore
Created May 16, 2011
Mousy - A shared cursor for webpages using Node.js
View .gitignore
node_modules
public/socket.io.min.js
public/jquery.js
@mixonic
mixonic / components.my-component.display-part.js
Created May 16, 2019
Component with re-usable content components
View components.my-component.display-part.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
root: 'aa',
appName: Ember.computed('root', {
get() {
return this.get('root');
},
set(key, value) {
let newValue = value;
@mixonic
mixonic / controllers.application.js
Created May 3, 2019
Named export, default import
View controllers.application.js
import Ember from 'ember';
import NamedExports from './exporting';
export default Ember.Controller.extend({
appName: NamedExports.appName
});
View components.inner-component.js
import Ember from 'ember';
export default Ember.Component.extend({
log: Ember.computed(() => []),
open() {
this.get('log').pushObject('opened!');
},
didInsertElement() {
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
function noOverride () {
// cannot override
}
const Parent = Ember.Controller.extend({
init() {
this._super();
if (this.__proto__.noOverride !== noOverride) {