-
This shows the steps needed to get Ember Simple Auth to work with Ember Engines as if they are the same application
-
Things to note
- engine login page needs to
transitionToExternal('login') - login has to be passed in as an external route to the engine
- session and cookie services both need to be passed into engine
- sessionAuthenticated function needs to be overwritten in the Application Controller of the Engine
- engine login page needs to
-
in /app/app.js add to const engines object { [Engine Name]: dependencies }
This file contains hidden or 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
| class Trie | |
| attr_accessor :word, :trie | |
| def initialize | |
| @trie = {} | |
| @word = false | |
| end | |
| def <<(string) | |
| node = string.each_char.inject(self) { |node, char| node.trie[char] ||= Trie.new } |
This file contains hidden or 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
| class Node | |
| attr_reader :data, :children | |
| attr_accessor :term | |
| def initialize(data) | |
| @data = data | |
| @children = [] | |
| @term = false | |
| end | |
| def insert(char) |
This file contains hidden or 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 DS from "ember-data"; | |
| export default DS.JSONAPIAdapter.extend(); |
Hi
I am Henrik and I want to create a webextension generator that supports chrome, firefox, opera and safari. The stack I would like to use will contain:
This file contains hidden or 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
| class Point | |
| attr_accessor :x, :y | |
| # Constructor that takes in an x,y coordinate | |
| def initialize(x,y) | |
| @x = x | |
| @y = y | |
| end | |
| # Calculates the distance to Point p |
This file contains hidden or 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'; | |
| class ItemRating extends HTMLElement { | |
| createdCallback () { | |
| this.insertAdjacentHTML('afterbegin', ` | |
| <a data-rating="1">★</a> | |
| <a data-rating="2">★</a> | |
| <a data-rating="3">★</a> | |
| <a data-rating="4">★</a> | |
| <a data-rating="5">★</a> |
This file contains hidden or 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
| var expect = require('expect') | |
| var _matches = { | |
| '{': { invert: '}', isOpening: true }, | |
| '}': { invert: '{', isOpening: false }, | |
| '(': { invert: ')', isOpening: true }, | |
| ')': { invert: '(', isOpening: false }, | |
| '[': { invert: ']', isOpening: true }, | |
| ']': { invert: '[', isOpening: false } | |
| }; |
This file contains hidden or 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
| /** | |
| * Implement function check (text) which checks whether brackets within text are correctly nested. | |
| * You need to consider brackets of three kinds: (), [], {}. | |
| */ | |
| /** | |
| * STACK approach | |
| */ | |
| function check(str){ | |
| var brackets = "()[]{}", |
This file contains hidden or 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
| find ~/.bundle/cache -type d -exec chmod 0755 {} + |