npx https://gist.github.com/emilioriosvz/8ce9745e98276f4a288bad062d6f01b3
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
| var getAllProperties = function (object) { | |
| var properties = [] | |
| do { | |
| Object.getOwnPropertyNames(object).forEach((prop) => { | |
| if (!~properties.indexOf(prop)) { | |
| properties.push(prop) | |
| } | |
| }) | |
| } while (object = Object.getPrototypeOf(object)) |
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
| var o = { | |
| '1': 'adios', | |
| '2': 1.5, | |
| '3': true, | |
| '4': [1, 2, 3], | |
| '5': {1: 2} | |
| } | |
| const getTypes = obj => { | |
| return Object.keys(obj).reduce((prev, key) => { |
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 objectComparator = (a, b) => { | |
| if (a === b) { | |
| return { | |
| changed: 'equal', | |
| value: a | |
| } | |
| } | |
| var value = {} | |
| var equal = 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
| var rl = readline.createInterface({ | |
| input: fs.createReadStream(filePath), | |
| crlfDelay: Infinity | |
| }) | |
| rl.on('line', async (line) => { | |
| counter += 1 | |
| rl.pause() | |
| // some async code | |
| rl.resume() |
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
| var fs = require('fs'); | |
| var fstream = require('fstream') | |
| var tar = require('tar'); | |
| var zlib = require('zlib'); | |
| var gzip = zlib.createGzip(); | |
| //var deflate = zlib.createDeflate(); | |
| var dirSrcName = process.argv[2] || __dirname; | |
| var dirDestName = process.argv[3] || './dir.tar.gz' | |
| var dirDestStream = fs.createWriteStream(dirDestName); |
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
| #!/usr/bin/env node | |
| const getName = name => { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| resolve(name) | |
| }, 500) | |
| }) | |
| } |
sudo yum -y update
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
cd /tmp
curl -L http://download.osgeo.org/gdal/2.0.0/gdal-2.3.2.tar.gz
tar -xvzf gdal-2.3.2.tar.gz
cd gdal-2.3.2/
./configure --prefix=/usr/local --without-python
AT
AT+CIOBAUD=9600
AT+GMR
AT+CWMODE?
AT+CWMODE=3
AT+CWMODE?
AT+CWLAP
AT+CWJAP="wifi_SSID","your_wifi_password"
AT+CIPMUX=1
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 { createReadStream, createWriteStream } = require('fs') | |
| const { Transform } = require('stream') | |
| const stream = createReadStream('./text.txt') | |
| const writeStream = createWriteStream('./result.txt') | |
| const transformStream = new Transform({ | |
| transform (chunk, encoding, done) { | |
| let text = String(chunk) | |
| text = text.toLowerCase().replace(/hola/g, 'adiós') | |
| done(null, text) |
OlderNewer