I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
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 socket, time | |
| s = socket.socket() | |
| address = '' | |
| port = 5577 | |
| r = 0 | |
| g = 255 | |
| b = 0 | |
| keybit = "31".replace(':', '').decode('hex') | |
| keybit += chr(r) + chr(g) + chr(b) | |
| keybit += "00:f0:0f".replace(':', '').decode('hex') |
Say that you have some-addon and other-addon, and both have a foo service, and both export app/services/foo.js.
What you would observe is that other-addon would win over some-addon providing the foo service in your consuming app, because modules are resolved alphabetically.
To get around this, you can essentially proxy the services in your app folder, like so:
// app/services/foo-a.js
export { default } from 'some-addon/services/foo';
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
| export default class MailgunClient { | |
| apiKey: string; | |
| domain: string; | |
| defaults?: { | |
| from?: string; | |
| subject?: string; | |
| }; | |
| constructor(apiKey: string, domain: string, defaults?: Record<string, any>) { | |
| this.apiKey = apiKey; |