Skip to content

Instantly share code, notes, and snippets.

View courthead's full-sized avatar

Courtland Allen courthead

View GitHub Profile
<html>
<head>
<title>Testing!</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/stream-chat-react@latest/dist/css/index.css"></link>
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
<script src="https://cdn.jsdelivr.net/npm/stream-chat@latest" crossorigin></script>
class GameTreeNode {
constructor(obj = {}) {
this.parentNode = obj.parentNode || null;
this.upNode = null;
this.rightNode = null;
this.downNode = null;
this.leftNode = null;
this.minScore = obj.parentNode ? obj.parentNode.minScore + 1 : 0;
class GameTreeNode {
constructor(obj = {}) {
this.parentNode = obj.parentNode || null;
this.upNode = null;
this.rightNode = null;
this.downNode = null;
this.leftNode = null;
this.minScore = obj.parentNode ? obj.parentNode.minScore + 1 : 0;
import Ember from 'ember';
export function optionalFunction(orderedArgs/*, namedArgs*/) {
const actionFn = orderedArgs[0];
return function (event) {
return actionFn ? actionFn(event) : undefined;
};
}
export default Ember.Helper.helper(optionalFunction);
import Ember from 'ember';
export default Ember.Controller.extend({
prop: 'a',
actions: {
setPropToA() {
this.set('prop', 'a');
this.notifyPropertyChange('prop');
},
@courthead
courthead / application.controller.js
Created December 17, 2015 02:31
Undefined closure actions
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
handleClickOnA: function () {
alert('a was clicked');
}
}
@courthead
courthead / application.controller.js
Created November 20, 2015 23:12
action bubbling weirdness
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
reportClick(element) {
alert(element);
}
}
new Firebase('https://handle-experimental.firebaseio.com/userEntities')
.orderByChild('chromeSettings/handle_@@_chromeSettings_@@_common_@@_ID/lastSeen')
.startAt("2015-10-27T00:00:00.000Z")
.on('child_added', function (snapshot) {
console.log(snapshot.val());
});
Integrating with Forms
[ ] hidden input field with id matching <trix-editor>'s input attr
Populating wth Stored Content
[ ] To populate a <trix-editor> with stored content, include that content in the associated input element’s value attribute.
Storing Attached Files
[ ] provide Trix with a permanent URL for attached files
[ ] to store attachments, listen for the trix-attachment-add event
[ ] call preventDefault() on the trix-file-accept event to disallow attachments