Skip to content

Instantly share code, notes, and snippets.

View t4t5's full-sized avatar

Tristan t4t5

View GitHub Profile
@t4t5
t4t5 / onename.txt
Last active May 22, 2016 07:59
Onename verification
Verifying that +tristan is my Bitcoin username. You can send me #bitcoin here: https://onename.io/tristan
Verifying that "tristan.id" is my Blockstack ID. https://onename.com/tristan
@t4t5
t4t5 / component.ts
Last active April 3, 2017 13:31
glimmer-todo-list-1
// src/ui/components/todo-list/component.ts
import Component from "@glimmer/component";
export default class TodoList extends Component {
items = [
{
text: "Install Glimmer",
isDone: false,
@t4t5
t4t5 / template.hbs
Last active April 3, 2017 13:42
todo-list-template-1
{{! src/ui/components/todo-list/template.hbs }}
<div id="todo-app">
<ul>
{{#each items key="@index" as |item|}}
<li>
{{item.text}}
</li>
{{/each}}
@t4t5
t4t5 / template.hbs
Created April 3, 2017 14:03
todo-item-template-1
{{! src/ui/components/todo-item/template.hbs }}
<li>
<p>
{{@item.text}}
</p>
<button>
Delete item
</button>
@t4t5
t4t5 / template.hbs
Created April 3, 2017 14:52
todo-list-template-2.hbs
{{! src/ui/components/todo-list/template.hbs }}
<div id="todo-app">
<ul>
{{#each items key="@index" as |item|}}
<todo-item
@item={{item}}
/>
{{/each}}
@t4t5
t4t5 / component.ts
Created April 3, 2017 14:53
todo-list-component-2
// src/ui/components/todo-list/component.ts
import Component, { tracked } from "@glimmer/component";
export default class TodoList extends Component {
@tracked newItemText = '';
@tracked items = [
{
@t4t5
t4t5 / template.hbs
Last active April 4, 2017 11:01
todo-item-template-2
{{! src/ui/components/todo-item/template.hbs }}
<li>
<p
data-checked={{@item.isDone}}
onclick={{action @toggleItem @item}}
>
{{@item.text}}
</p>
@t4t5
t4t5 / component.ts
Created April 3, 2017 15:13
todo-item-component
// src/ui/components/todo-item/component.ts
import Component from '@glimmer/component';
export default class TodoItem extends Component {
delete() {
let item = this.args.item;
this.args.deleteItem(item);
}
@t4t5
t4t5 / template.hbs
Last active April 3, 2017 15:17
todo-list-template-3
{{! src/ui/components/todo-list/template.hbs }}
<div id="todo-app">
<ul>
{{#each items key="@index" as |item|}}
<todo-item
@item={{item}}
@deleteItem={{action deleteItem}}
@toggleItem={{action toggleItem}}