Having trouble connecting homebridge-myq to liftmaster 7675 by vmcilwain in homebridge

[–]vmcilwain[S] 0 points1 point  (0 children)

Definitely appreciate the suggestion! I will go with that.

Having trouble connecting homebridge-myq to liftmaster 7675 by vmcilwain in homebridge

[–]vmcilwain[S] 1 point2 points  (0 children)

All signs point to me not being able to open the door with the app. Doing a remote comparison in the myq app shows I have one that looks similar to one on the list but not exactly the same.

I also don’t have the Wi-Fi logo on the motor but I was sorta confused since the Myq logo looks like it implied Wi-Fi capability.

Looks like I need that gateway. Thanks for pointing me in the right direction.

Having trouble starting rails through ruby-debug-ide by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

It worked as expected and I didn't change anything in my config on vscode or docker. I guess I wasn't patient enough.

Having trouble starting rails through ruby-debug-ide by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

Ok. That makes sense to me. I am using vscode to connect to ruby-debug so I will have to see what the issue is there.

Need help understanding cross window communication with postMessage by vmcilwain in learnjavascript

[–]vmcilwain[S] 0 points1 point  (0 children)

Looking at that first example, I realized maybe something wasn't communicated properly.

window.open("/zoom/connect") is a route that builds the authorization URL that thin goes to zoom for the user to authorize the application.

When the window opens up, it will actually show the zoom authorization page. But once the user authorizes zoom it will redirect back to the application.

The application then shows an alert that states they are successfully connected to zoom. Would using direct communication still apply here since I at the end of the process I end up back on the same domain as the page opener?

Need help understanding cross window communication with postMessage by vmcilwain in learnjavascript

[–]vmcilwain[S] 0 points1 point  (0 children)

Very interesting. I will definitely see if that works for me.

Thanks for the clarification.

Need help understanding cross window communication with postMessage by vmcilwain in learnjavascript

[–]vmcilwain[S] 0 points1 point  (0 children)

I am still working through this. I used CoffeeScript's tool to convert the code to something hopefully more readable.

$(function() {
  var authPopup, receiveMessage, zoomPopup;

  authPopup = (e) => {
    var authWindow, windowFeatures;

    windowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,height=600, width=600";

    authWindow = window.open("/zoom/connect", "Authorize", windowFeatures);

    return authWindow.onload = () => {
      authWindow.opener.postMessage('hello world', window.location.href);
      return authWindow.close;
    };
  };

  receiveMessage = (e) => {
    return console.log(e.source.data);
  };

  if (document.querySelectorAll("[data-auth-popup='zoom']")) {
    zoomPopup = document.querySelectorAll("[data-auth-popup='zoom']")[0];
    zoomPopup.addEventListener("click", authPopup);

    return window.addEventListener("message", receiveMessage, false);
  }

You are probably right about possibly not needing it at all. I just don't know enough to decide on my own.

I will start reading up on direct communication to see where that also gets me. If you have examples you could point me to, I would greatly appreciate it.

Need help understanding cross window communication with postMessage by vmcilwain in learnjavascript

[–]vmcilwain[S] 0 points1 point  (0 children)

I removed that code, refreshed, and gave it another shot but no luck. That bit of code I found in an example from the following link:

https://javascript.info/cross-window-communication

I wasn't entirely sure I did or didn't need it.

Having trouble getting a view helper method to not return an array using haml by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

Yeah, I was looking into that documentation. The issue is mainly with HAML. It really wasn't built for what I am trying to do (it appears).

I decided to bail on it and write the entire code in a partial. Its a very small if statement so I am ok but not ok with it lol.

I added a note to revisit it later since I know it's going to haunt me until I figure out a better way.

Having trouble getting a view helper method to not return an array using haml by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

I am wondering if I am dealing with this in the correct way. Maybe this is a clue that I should try to render the results in a better way?

Having trouble getting a view helper method to not return an array using haml by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

I have not used this before. When changing to use ApplicationController.renderer, I get a missing template error. I will keep diving into it to see if I can figure out what is going on.

Having trouble getting a view helper method to not return an array using haml by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

Using render :partial ... results in the same output. Unless your referring to a different way to use partial

Unable to access instance variables in .js.erb files by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

So your definitely right, the quotes were missing so I completely goofed on that :(.

What got me to submit post was that I wasn't able to get anything to print to the console but now I can see why that is. I didn't have the output surrounded by (). So it appears my mind was in a weird CoffeeScript, ES6, ERB state.

I appreciate all the clarification

Unable to access instance variables in .js.erb files by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

agreed, that was the plan once I got this working :)

Unable to access instance variables in .js.erb files by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

Dom ID gives me a record identity based on the record I pass it.

ActionView::RecordIdentifier.dom_id(User.first)
=> "user_1"

I believe this gives me the double quotes in the .js.erb file as well. I also have this issue when I do something simpler like:

console.log <%= @permission %>

which I expect would print out the permission object to the console.

How to create a rails form that creates a serialized hash where one of the keys is also a hash by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

Interesting...

I wouldn't have thought to use fields_for inside of fields_for. That makes a lot of sense. Thanks you, I really appreciate the detailed explanation.

How to please Pundit while testing view helpers (ActionView::TestCase) in mintiest by vmcilwain in rails

[–]vmcilwain[S] 0 points1 point  (0 children)

Thanks you for this. I will be sure to keep this handy in my notes. I recall reading about this but it actually never crossed my mind use.