Skip to content

Instantly share code, notes, and snippets.

View NullVoxPopuli's full-sized avatar

NullVoxPopuli

View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
didInitAttrs(options) {
console.log('didInitAttrs', options);
},
didUpdateAttrs(options) {
console.log('didUpdateAttrs', options);
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@NullVoxPopuli
NullVoxPopuli / README.md
Last active March 20, 2017 21:42
Example TODO app

Introduction to Ember via TODOs

Requirements

These requirements will be used in future blog posts with other frameworks.

  • Clear the list of TODOs
  • Be able to add TODOs
    • Focus should be taken after the add button is clicked.
  • hitting escape / enter / clicking off the new-todo should commit the todo to the list
@NullVoxPopuli
NullVoxPopuli / components.sortable-table.js
Last active October 8, 2016 17:41
Sortable Table Component
import Ember from 'ember';
export default Ember.Component.extend({
columns: [],
evaluatedColumns: [],
data: [],
/*
Currently, only works on one column.
Can only sort one column at a time.
@NullVoxPopuli
NullVoxPopuli / application.controller.js
Created April 13, 2016 14:13 — forked from spieker/application.controller.js
nested attributes ember example
import Ember from 'ember';
import Serializer from '../serializers/author';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
serialized: Ember.computed(function() {
return JSON.stringify(this.get('model').serialize(), null, 2);
})
});
@NullVoxPopuli
NullVoxPopuli / README.md
Last active November 25, 2018 11:54
MeshRelay Action Cable Tests

Automated Message Sending

run in seperate terminals in this order:

  • mesh_relay_user_1.rb
  • mesh_relay_user_2.rb
    • sends a message to user 1
  • mesh_relay_user_3.rb
    • sends a message to user 1
require 'awesome_print'
log_methods = [:perform, :dispatch_message]
set_trace_func proc {
|event, file, line, id, binding, classname|
if event == "call" #or event == "return"
if log_methods.include?(id)
printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
vars = binding.local_variables
webdev@ubuntu 192.168.163.129 ~/Development/meshchat
⬡ v5.10.1 💎 2.3.0@meshchat (refactor) $ rspec
I, [2016-05-03T14:19:18.132368 #18518] INFO -- : Reporting coverage data to Code Climate.
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 27611
Meshchat::Network::Message::NodeList
@NullVoxPopuli
NullVoxPopuli / components.my-component.js
Last active May 10, 2016 14:00
Unit Test Component?
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: [
'hasError:error:no-error', 'classes',
],
errors: [],
includeFieldName: false,
field: '',
@NullVoxPopuli
NullVoxPopuli / angular-pls.md
Last active July 9, 2020 08:12
Anti Patterns (and things I don't like) in Angular2

General

Templates written a giant string in components.

This tutorial demonstrates this: https://angular.io/docs/ts/latest/tutorial/toh-pt1.html you don't get syntax coloring, or any benefits you'd get from a good html/templating tool.

(( flashbacks to inline html strings in C++ ))

Tag bloat with ngDirectives (such as ngFor)

from an angular.io example: