This file contains hidden or 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
'use strict'; | |
const { | |
cbFunction, | |
cbFunctionPromisify | |
} = require('./modules/util'); | |
const dataError = {error: true, message: 'I am an unicorn !!!'}; | |
const dataResult = {error: false, message: 'I am an unicorn !!!'}; |
This file contains hidden or 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
'use strict'; | |
const { | |
inspect | |
} = require('util'); | |
console.log('inspect', inspect(callbackify, { showHidden: true, depth: null , colors: true }));//reusando funcion de ejemplo de callbackify | |
console.log('inspect Calc', inspect(Calc, { showHidden: true, depth: null, colors: true }));// reusando funcion de ejemplo de inherits | |
console.log('inspect Calc 2', inspect([Calc, true, 123, 'jesse', undefined, null], { showHidden: true, depth: null, colors: true })); |
This file contains hidden or 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
'use strict'; | |
const { | |
Calc | |
} = require('./modules/util'); | |
const calc = new Calc(); | |
console.log('calc', Calc); |
This file contains hidden or 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
'use strict'; | |
const { | |
format | |
} = require('util'); | |
const strFormat = format('%s:%s', 'foo');//%s -> string | |
console.log('strFormat', strFormat); | |
const numberFormat = format('%d:%d', 5.2); |
This file contains hidden or 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
const { | |
deprecate | |
} = require('util'); | |
const myCoolFn = deprecate((name) => { | |
return `${name} is very cool !!!`; | |
}, 'myCoolFn is deprecated !!! =('); | |
module.exports = { | |
myCoolFn |
This file contains hidden or 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
'use strict'; | |
const { | |
debuglog | |
} = require('util'); | |
const debuglogFnFoo = debuglog('foo'); | |
const debuglogFnBar = debuglog('bar'); | |
const debuglogFncbfy = debuglog('cbify'); | |
// Multiple comma-separated section names may be specified in the NODE_DEBUG environment variable. |
This file contains hidden or 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
'use strict'; | |
const { | |
callbackify | |
} = require('util'); | |
const asyncFn = async function (text) { | |
if (text === true) { | |
return await Promise.reject(`parce, no me mande un true !!!`); | |
} |
This file contains hidden or 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
Verifying that "jessecogollo.id" is my Blockstack ID. https://onename.com/jessecogollo |
This file contains hidden or 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 #include statement was automatically added by the Particle IDE. | |
#include "InternetButton/InternetButton.h" | |
// #include <iostream> | |
// #include <string> | |
int tinkerDigitalWrite(String command); | |
InternetButton b = InternetButton(); | |
/* This function is called once at start up ----------------------------------*/ | |
void setup() |
This file contains hidden or 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
'use strict' | |
// important: particle flash 400033001047343432313031 tinker | |
// permite que se ejecute codigo js. | |
const spark = require('spark') | |
spark.on('login', function () { | |
// If login is successful we get and accessToken, | |
// we'll use that to call Spark API ListDevices | |
var devicesPr = spark.listDevices() |