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.
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
options: [ | |
{ name: 'Apple', value: 'apple'}, | |
{ name: 'Banana', value: 'banana'}, | |
{ name: 'Other', value: 'other'} | |
], | |
selected: { name: 'Banana', value: 'banana'}, |
// addon/services/ajax.js | |
// ensure custom ajax requests have the appropriate authorization headers when signed in | |
import Ember from 'ember'; | |
import AjaxService from 'ember-ajax/services/ajax'; | |
const { | |
computed, | |
inject, | |
get | |
} = Ember; |
This is a tutorial on how to setup Kafka 0.9.0.0 on CentOS 7 with Kerberos. This configuration aims to set up all services on a single host called myserver.domain.com
in the Kerberos realm DOMAIN.COM
for testing purposes
This configuration requires that you have the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files installed. You can download these from the Java Downloads page under the Additional Resources section.
Ashrithr made a very helpful tutorial on how to install Kerberos. Please use these instructions to set up Kerberos.
Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element
or the /deep/
path selector.
video::webkit-media-controls-timeline {
background-color: lime;
}
video /deep/ input[type=range] {
I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api
Rails.application.routes.draw do
constraints subdomain: "api" do
scope module: "api" do
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", |
In Ember, always use {{...}}
, not {{{...}}}
. Use Ember.String.htmlSafe
as necessary in JavaScript (usually in a component)
to mark markup as HTML-safe. Never pass user-entered content directly to Ember.String.htmlSafe
.
Ember has great XSS protection built in. The HTMLBars templating library will automatically run any interpolations through
htmlEscape
for you. So
# Add field | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
# { | |
# "hello": "world", | |
# "foo": "bar" | |
# } | |
# Override field value | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
{ |