Ember's official documentation describes a number of low-level APIs, but doesn't talk much about how to put them together. As a result, a simple task such as creating a simple CRUD application is not obvious to a newcomer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is an example of use of `errorStateWorkaround` | |
import Ember from 'ember'; | |
import { test } from 'qunit'; | |
import moduleForAcceptance from 'my-app/tests/helpers/module-for-acceptance'; | |
import errorStateWorkaround from 'my-app/tests/helpers/error-state-workaround'; | |
moduleForAcceptance("Acceptance | errors", { | |
beforeEach: function() { | |
errorStateWorkaround.setup(err => { | |
// Return `true` if `err` is the error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { computed, get } = Ember; | |
export default Ember.Controller.extend({ | |
queryParams: ['foo', 'bar'], | |
foo: '', | |
bar: '', | |
formattedModel: computed('model.{foo,bar}', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.TextField.extend({ | |
attributeBindings: ['data-toggle', 'data-placement'] | |
}); |
The arm is powered by a Phidgets Advanced Servo 8-motor controller. See https://www.phidgets.com/?tier=3&catid=21&pcid=18&prodid=56 Comes with a USB cable (to connect to the computer) and a power supply that uses 4 AA batteries.
To see the API reference:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as follows: | |
# | |
# rackup -o 0.0.0.0 -O Threads=0:1 | |
# | |
require 'json' | |
require 'pp' | |
run (Proc.new do |env| | |
req = Rack::Request.new(env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'pp' | |
require 'sequel' | |
module CaptureOutput | |
module_function | |
def capture_stdout(&block) | |
Private.capture(STDOUT, &block) | |
end |
NewerOlder