This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Loop for doesn't work | |
/* | |
for (var i=1; i < 5; i++) { | |
setTimeout(function () { | |
console.log('test'); | |
}, 3000); | |
} | |
*/ | |
// Solution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code will generate 10 iterations | |
(function test(i){ | |
console.log('test'+i); | |
// put here the code of anything you want to execute | |
if(i--){ | |
test(i) | |
} | |
})(10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
// Reade file synchronously and put the result in buffer | |
var file = fs.readFileSync('fileName.pdf'); | |
// Code the file in base64 | |
var base64EncodedPDF = new Buffer(file).toString('base64'); | |
// Decode the file | |
var baseDecodedPDF = new Buffer(base64EncodedPDF, 'base64'); | |
// Get the decoded file in its original format | |
fs.writeFileSync('decodedPDF.pdf', baseDecodedPDF); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var XLSX = require('xlsx'); | |
var workbook = XLSX.readFile('fileName.xlsx'); | |
var sheet_names = workbook.SheetNames;//array of sheet names | |
//console.log(sheet_names); | |
var worksheet = workbook.Sheets; | |
for(x in sheet_names) { | |
worksheet = workbook.Sheets[sheet_names[x]]; | |
//console.log(worksheet); | |
var header = []; //initialize header array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REQUIREMENTS: | |
- php-pear (install automatically php7.0-xml and php-xml) | |
sudo apt-get install php-pear | |
-php7.0-mbstring | |
sudo apt-get install php7.0-mbstring | |
-php7.0-dev | |
sudo apt-get install php7.0-dev | |
INSTALLATION: | |
1- cd /tmp/xxxxxx (e.g: cd /tmp/pear/download) |
NewerOlder