Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jerosoler's full-sized avatar
:octocat:
Working from home

Jero Soler jerosoler

:octocat:
Working from home
View GitHub Profile
@jerosoler
jerosoler / pauseallplayers.js
Created May 16, 2023 18:05
Stop others players playing with wave-audio-path-player
document.querySelector("body").addEventListener("click", (e) => {
if(e.target.tagName == "WAVE-AUDIO-PATH-PLAYER") {
const elementToPlay = e.target;
if(elementToPlay.audio.paused === false) {
const players = document.querySelectorAll("WAVE-AUDIO-PATH-PLAYER");
players.forEach(ele => {
if(ele.audio.paused === false) {
ele.playPause();
}
});
@jerosoler
jerosoler / app.js
Created January 3, 2018 16:28
Node mysql auto connect and close
var mysql = require('mysql');
var db_config = {
host : 'localhost',
user : 'usuario',
password : 'password',
database : 'ddbb'
};
var connection = {};