Skip to content

Instantly share code, notes, and snippets.

View ThomRoman's full-sized avatar

ThomRoman

View GitHub Profile
@ThomRoman
ThomRoman / README.md
Last active March 26, 2021 23:55
Procesos hijos en Node js

Procesos hijos en Node

El módulo de procesos secundarios de Node.js (child_process) tiene dos funciones spawn y exec, mediante las cuales podemos iniciar un proceso secundario para ejecutar otros programas en el sistema.

La diferencia más significativa entre child_process.spawn y child_process.exec está en lo que spawn devuelve un stream y exec devuelve un buffer.

  • Usa spawn cuando quieras que el proceso hijo devuelva datos binarios enormes a Node.
  • Usa exec cuando quieras que el proceso hijo devuelva mensajes de estado simples.
@ThomRoman
ThomRoman / file-system.js
Created March 26, 2021 23:22
FileSystem promise
const fs = require('fs').promises;
async function escribir(path,contenido){
try{
await fs.writeFile(path,contendio)
}catch(err){
console.error(error)
}
}
print(type(sc)) # pyspark.contex.SparkContext
integerList = range(1,1001)
print(leng(integerList))
integerListRDD = sc.parallelize(integerList,8)
print(type(integerListRDD))
print(integerListRDD.getNumPartitions())
for A in $(ls /usr/lib/ | grep X); do echo $A; done
@ThomRoman
ThomRoman / srtf.cpp
Last active November 28, 2020 04:22
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string.h>
using namespace std;
struct process {
int pid;
int arrival_time;
int burst_time;
@ThomRoman
ThomRoman / prog.asm
Last active November 22, 2020 23:46
LIST P=PIC16F628A
INCLUDE <P16F628A.INC>
TIEMPO EQU 21H
ORG 0x00
GOTO INICIO
INICIO
https://yangshun.github.io/tech-interview-handbook/
https://www.youtube.com/watch?v=pQ34URiXThk
https://www.youtube.com/watch?v=hb_mje73TTE
window.onload = function(){
/** UNSAFE with localStorage **/
let jwt = null
onLogin(){
jwt = await login()
}
onDataFetch(){