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
# Runs assert_difference with a number of conditions and varying difference | |
# counts. | |
# | |
# Call as follows: | |
# | |
# assert_differences([['Model1.count', 2], ['Model2.count', 3]]) | |
# | |
def assert_differences(expression_array, message = nil, &block) | |
b = block.send(:binding) | |
before = expression_array.map { |expr| eval(expr[0], b) } |
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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
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
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too. | |
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready! | |
Resources: | |
sslSecurityGroupIngress: | |
Type: AWS::EC2::SecurityGroupIngress | |
Properties: | |
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]} | |
IpProtocol: tcp | |
ToPort: 443 |
Many people are confused by the {{mut}}
helper because it seems very magical. This gist aims to help you construct a mental model for
understanding what is going on when you use it.
Prior to the introduction of {{mut}}
, form elements were two-way bound by default.
That is, given this component:
import Ember from 'ember';
export default Ember.Component.extend({
- Routes dedicated to looking up a specific id'd model should use the
afterModel(resolvedModel, transition)
to perform any security checks concerning whether the current user is permitted to the given route. OBVIOUSLY the server-side API should prevent access, but if it doesn't this is a place to make that happen. An example of this kind of route isusers.user
where theapp/routes/users/user.js
is responsible for looking up a user with a specific id. If the requesteduser
model comes back from the server without a 401, you can further check the model with additional client-side logic to make sure that the current user is permitted to operate on it. - Events (e.g. clicks) should be handled by an action defined in the route. Use route-action helper. Why? Promotes component re-usability by it not being responsible for reacting to the event while the route serves a specific use case and can respond accordingly to the event.
- In order to unit
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
# .circleci/config.yml | |
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/node:6-browsers | |
environment: | |
JOBS: 2 | |
working_directory: ~/gitzoom-web | |
steps: |
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
// Credits to the following posts that helps me to reduce build times drastically | |
// https://discuss.emberjs.com/t/tips-for-improving-build-time-of-large-apps/15008/12 | |
// https://www.gokatz.me/blog/how-we-cut-down-our-ember-build-time/ | |
//ember-cli-build.js | |
let EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
let env = EmberApp.env(), |