Skip to content

Instantly share code, notes, and snippets.

View ejuher's full-sized avatar

Erich Uher ejuher

View GitHub Profile
@ejuher
ejuher / components.connection-rater\.js
Last active August 3, 2022 19:26 — forked from gerry3/components.connection-rater\.js
Connection Rater Interview
import Component from '@glimmer/component';
export default class extends Component {
constructor() {
super(...arguments);
// connections is provided here and is the same as @connections in the hbs file
const connections = this.args.connections
// 1) Apply the class "alert-info" to the first connection
@ejuher
ejuher / components.connection-rater\.js
Last active November 19, 2020 00:55
Connection Rater Erich
import Component from '@glimmer/component';
export default class extends Component {
activeIndex = 0;
constructor(owner, args) {
super(owner, args); // what is owner?
// connections is provided here and is the same as @connections in the hbs file
const connections = args.connections
connections[this.activeIndex].active = true;
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle TEST';
}
schema_path = [0, 1, 2].map do |n|
File.join("prod-backup", "schemas", (Time.current - n.days).strftime("%Y_%m_%d"))
end.select do |filepath|
File.exist? File.join(File::SEPARATOR, "Volumes", filepath)
end.first || "file not found"
# changed to:
n = 0; schema_path = "file not found";
while n < 3 && schema_path == "file not found" do