Skip to content

Instantly share code, notes, and snippets.

View lk321's full-sized avatar
🤓
Focusing

Antonio Orozco lk321

🤓
Focusing
View GitHub Profile
@lk321
lk321 / gist:41fb523009e4aa72806b4f09ffe98362
Created January 29, 2020 17:21
Documentos de SAT digitalizados
// PDF FILES
gs \
-sDEVICE=pdfwrite \
-sPDFSETTINGS=prepress \
-sCompatibilityLevel=1.4 \
-r300 \
-r300x300 \
-sDownScaleFactor=3 \
-sProcessColorModel=DeviceGray \
Realizar proyecto en NodeJS donde muestres si es numero par o impar
Detalle:
El numero se lo mandaras a través de la URL (Sera una api en NodeJS).
donde tendrás que hacer la operación para saber si es numero par o impar mostrando el siguiente mensaje:
- El numero "X" es un numero [par | impar]
Ejemplo de URL:
http://localhost:8080/ejemplo?numero=10
@lk321
lk321 / install.sh
Created January 3, 2019 00:13
sync icloud
#!/bin/bash
#
# v1.0.0
# [LINK]: https://github.com/markogresak/cloud-ignore-files
# Usage:
# - Call script to register sync script with launchd.
# - Call with `--no-logs` to disable logging.
# - Call with `--uninstall` or `--remove` to unregister from launchd and clean up files.
# Adjust the paths to match your system (do not end the path with /).
// Old
function Poligono(height, width) {
this.height = height;
this.width = width;
}
Poligono.prototype.area = function() {
return this.height * this.width;
};
@lk321
lk321 / index.js
Last active November 27, 2018 18:39
Import files with index
const path = require('path');
require('fs').readdirSync(__dirname).forEach((file) => {
/* If its the current file ignore it */
if (file === 'index.js') return;
const MODULE = require(path.join(__dirname, file));
module.exports[path.basename(file, '.js')] = MODULE.default || MODULE;
});
@lk321
lk321 / x12.js
Last active October 11, 2023 14:18
EDI X12 Parse to JSON - NodeJS
import fs from 'fs';
export default class X12 {
constructor(file) {
if (file.includes('/')) {
fs.readFile(file, 'utf8', (err, contents) => {
return this.parseTextToJSON(contents);
});
} else {
----------------------------134606074717522154894905
Content-Disposition: form-data; name="fake"; filename="940.edi"
Content-Type: application/octet-stream
ISA*01*0000000000*01*0000000000*ZZ*ABCDEFGHIJKLMNO*ZZ*123456789012345*101127*1719*U*00400*000003438*0*P*>
GS*OW*7705551212*3111350000*20000128*0557*3317*T*004010UCS
ST*940*0001
W05*N*538686**001001*538686
N1*ST*GRITS BREAD COMPANY*ZZ*00046349
N3*2100 SOUTHEAST AVE
Almacena los paquetes de Atom en GitHub con Sync-Settings