I am getting a bcrypt error stating that data and hash arguments are required, referencing line #44 in my routes.js file. From what I can tell, I am passing that information: the first parameter to bcrypt.compare is the user entered password, and the second is the hashed password retrieved from the db. What a…
Tag: javascript
How do I bind an angular 2 event to an svg object?
I have the following html: And the script: The result is it doesn’t execute dragKnob. If I instead use (click) it works as expected. Any ideas? Answer Drag events are not supported on SVG Elements: http://www.w3.org/TR/SVG/svgdom.html#RelationshipWithDOM2Events. if you want to do something while the obj…
Set div to hidden, then visible after time delay
I’m trying to have a yellow square appear on a black background after X amount of time (perhaps even after a random amount of time, but for now let’s just do fixed time). This code should hide the yellow square initially, then reveal it after 2 seconds. But it does not work. It also does not work …
(Highcharts) button inside tooltip can’t trigger
The button inside tooltip does’t have any action when clicked, even set onclick event. Here is an example below, http://jsfiddle.net/emzmvth4/ Answer Change pointer events property of the tooltip to ‘auto’. Live example http://jsfiddle.net/emzmvth4/1/
Vue.js Axios bug HTTP request change my array but don’t show change
I have a very strange problem in vue.js/axios. Scenario 1 : clear my products variable BEFORE send an HTTP request (see “<<<<< SCENARIO 1” mark). Then set products variable with a new array. It works but we see a flicker (due to the HTTP request duration). So I decided to clear the …
Is it possible to import *.vue files in a folder?
I hate repeating things in code. For now I am importing vue files like this in my main.js. Is there a way to do same thing with less lines? Could be great if I can assign variable name from filename. Can PHP help about it? But then how to compile main.js? I did not figured out. Answer I use this
Detect when “Inspect Element” is open
Samy Kamkar’s website, http://samy.pl, knows when the console is being opened and wipes the source/console when it does open. How does this work? Answer This took some digging. samy.pl has several levels of indirection and obfuscation on top of this code. It uses a different version of the detection cod…
Google oauth 2.0 API password change Username and Password not accepted
I have a form using nodemailer, xoauth2 with google APi oauth2, I updated the password last week and since then my app hasn’t worked and I get: ‘535-5.7.8 Username and Password not accepted. Learn more atn535 5.7.8 I’ve tried deleting the app and creating a new one, but its doesnt seem to pi…
Rethrowing error in promise catch
I found the following code in a tutorial: I’m a bit confused: does the catch call accomplish anything? It seems to me that it doesn’t have any effect, since it simply throws the same error that was caught. I base this on how a regular try/catch works. Answer There is no point to a naked catch and …
Vue.js – components data do not update
I have a Vue list that is based of an array and each array item renders a component where I bind the array item properties. This component has a mixed data, based on the binded properties The problem is that when I change the initial list array in any way, the mixed prop of the component maintains it’s …