Sending android push notification through node.js

I have recently been trying to send push notification to my android and ios devices. For ios I found that node-apn module will be used for handling this,but for android I haven't come across anything of that sort. Any help will be much appreciate...

Nolan's Promises/A+ JavaScript puzzles

I have read We have a problem with promises by Nolan Lawson for a few times, but still have some questions about promises in JavaScript. At the end of Nolan's post you can find answers for four puzzles (I've attached screenshots here).  So, I...

jqPlot and naming series

I'm trying out jqPlot, but I can't figure out how to set the name of the different series.  Currently, my code looks like this:  $(document).ready(function () {     $.jqplot('chartdiv', [         [[201201, 10], [201202, 20], [201203,...

possible to embed Github list of issues (with specific tag) on website?

Does anyone know of an easy way to embed the list of issues with a specific tag from github onto a website?  This is to embed a list of open bugs on a project website....

“ Uncaught (in promise) ” when calling the reject function inside a fetch 'then' method

Here is the code in question:  new Promise((resolve, reject) => {   const opts = {     credentials: 'same-origin',   };    fetch(`/_api/myAPI`, opts)   .then((res) => {     if (!res.ok) {       reject(res);     } else {       ...   If t...

phantomjs always giving parse error on windows [duplicate]

This question already has answers here:...

How to create a file using javascript in Mozilla Firefox

I want to write a function in javascript which creates a file and write some content to it, iam working with firefox, can anybody help me in this case.  Thanks......

Change angular material input style

I am trying to change the style of a angular material input.  So far I managed to change the background-color using :  md-input-container {     padding-bottom: 5px;     background-color: #222; }   The placeholder and label color using :   md-input-co...

Recommendation for jquery \ js physics engine

I am building a small web based game, using html 5. I need my game to work according to some simple physics. Can you recommend from first hand of any  jquery \ js physics engine?  Thank you...

JavaScript Function is run twice?

I'm a little bit confused.  I have a checkbox that a user can click which determines whether a Private Phone number on my page should be visible to all or only the administration. When the box is clicked I wanna make sure you are allowed to first...

useEffect Hook Not Firing After State Change

I have two sibling components that share state via context in react.  The shared state between the components is an array.  If I update arr state in one component, I want the other component to listen for that update and do something accordingly. Whe...

react.js ReactComponent does not offer setState()?

I seem to misunderstand some fundamental parts of React.js.  In http://facebook.github.io/react/docs/component-api.html  it says, that a react component has methods like setState().  But when I do this:  var MyComp = React.createClass({     getInitia...

Is there a JavaScript equivalent to Python's for loops?

So I was dissapointed to find out that JavaScript's for ( var in array/object) was not equivalent to pythons for var in list:.   In JavaScript you are iterating over the indices themselves e.g.   0,  1, 2, ...    where as with Python, you are ite...

hover mode on Chart.js

Is it possible to have the hover activated when you are not hovering over a specific 'point' in a line graph?   I want that particular tooltip to activate whenever I hover over any part of the chart.  Edit: something like this http://watchsto...

How to require or include scripts in indesign?

How do I load another script file and run a method on it?  I'm using InDesign javascript and I don't know how to include multiple files in the same script....

Change CSS value by using PHP

For example, I have this CSS script:  <style> .header{ background:none: color:#fff; } </style>   Then, I would like to change the header value to:  <style> .header{ background-color:#fff: color:#000; } </style>   The values ar...

Javascript expression in parentheses

var x = (1,2,3); alert(x);   This expression evaluates to 3.   How is this expression (1,2,3) called? Why does it return 3?...

Recursive layouts with Handlebars.js

I have a simple object hierarchy consisting of:  Category  String name  List childCategories;   I would like to represent this layout using handlebars in a generic way, but I am having trouble understand how to nest layouts. Given this layout:  <s...

Running 'ember server' causes builds to fail with an EEXIST error?

Got this random build error while running ember server today. Before you ask, here are my Ember CLI, Node and NPM versions:  version: 0.1.15 node: 0.10.33 npm: 2.1.8   I created a new Ember project using ember new [app name]. Everything worked. I the...

user.emailVerified doesn't change after clicking email verification link firebase

After learning sending email verification is possible in latest firebase, although the docs are missing that, I wanted to test it for myself.  Using the snippet below:    Auth.$onAuthStateChanged(function(firebaseUser) {     if (firebaseUser) {...

Is it possible to hide or scramble/obfuscate the javascript code of a webpage?

I understand that client side code must be readable from the browser but I wonder (since there are too many things that I ignore) if there are ways to obfuscate to code to the end user and, if not what is the best practice to "pack" the javas...

Is there an easy way to convert text into HTML in JavaScript? [duplicate]

This question already has answers here:...

Call Windows API from node.js msg

I am new at Node, I have this simple Node.js server works on windows   Server Code  var ws = require("websocket-server");  var server = ws.createServer();  server.addListener("connection", function(client){     console.log("new co...

What qualifies as being a dynamic export in ES6

I hear that dynamic exports/imports are not allowed in es6.   This website Uses the example export default 5 * 7; as if it were a legal, static export. This seems reasonable since it clearly evaluates to the static value of 35, but I'm wondering...

bcrypt Error: data and hash arguments required

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...

Current URL in Safari Extension

safari.application.activeBrowserWindow.activeTab.url is always undefined.  Any idea why this might be?...

How are anonymous objects garbage collected in Javascript?

If I create an object without assigning it to anything, when will Javascript garbage collect this object? Here is an example:  alert(new Date().getTime());   If no such garbage collection is done, will this cause a memory leak?  for (var i = 0; i <...

IIFE in AngularJS

I've specified a function in my controller like this:  $scope.myFunction = function(){ console.log('test'); }   I want this function to be triggered when a selectbox has been changed. Therefore I apply ng-change on the select element like...

WebRTC: Is it possible to control the microphone and volume levels

I am working on a demo site which includes a slide-out widget that allows a user to place a call.  I am using the SIPml5 tool along with the webrtc2sip back end for handling the call. That part is all set up and properly working. So now I am looking...

javascript var declaration within loop

/*Test scope problem*/ for(var i=1; i<3; i++){     //declare variables     var no = i;     //verify no     alert('setting '+no);      //timeout to recheck      setTimeout(function(){         alert('test '+no);     }, 500); }   It a...