Skip to content

Instantly share code, notes, and snippets.

👾
..... ᗧ.....ᗣᗣᗣ

Ruben Solorio rmar72

👾
..... ᗧ.....ᗣᗣᗣ
  • Denver, Colorado
Block or report user

Report or block rmar72

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rmar72
rmar72 / node_cluster_forking.js
Created Jul 14, 2019
Enabling the round-robin scheduler algo, since Win doesn't enable it by default
View node_cluster_forking.js
const cluster = require('cluster');
const http = require('http');
const numCPUs = require('os').cpus().length;
cluster.schedulingPolicy = cluster.SCHED_RR; // enables the round-robin scheduler algo, since Win doesn't enable it by default
if (cluster.isMaster) {
console.log(`Master ${process.pid} is running`);
// Fork workers
@rmar72
rmar72 / event_emitters.js
Created Dec 29, 2018
Practicing with Node.js Event Emitters
View event_emitters.js
// 10/25/2018
// Node practice from docs
//----- Experimenting with event emitters!
const EventEmitter = require('events');
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
myEmitter.on('myevento', () => {
@rmar72
rmar72 / node_buffers&streams.js
Last active Jun 24, 2019
Practicing with Node.js buffers & streams
View node_buffers&streams.js
// Node practice 09/25/18
/*
---------------------------Buffers --------------------------------------
Pure JavaScript is Unicode friendly, but it is not so for binary data.
While dealing with TCP streams or the file system, it's necessary to
handle octet streams. Node provides a Buffer class which provides instances
to store raw data similar to an array of integers but corresponds to a
raw memory allocation outside the V8 heap.
@rmar72
rmar72 / video to canvas.html
Created Dec 20, 2018
Video To Canvas, Color Inverted Frames
View video to canvas.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Video To Canvas, Color Invert Frames</title>
</head>
<style>
@rmar72
rmar72 / video stream for firefox.html
Created Dec 20, 2018
Minimal code to use webcam on Firefox browser
View video stream for firefox.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Go Live on Firefox/Chrome Camera</title>
</head>
<style>
@rmar72
rmar72 / video stream for chrome.html
Created Dec 20, 2018
Minimal code to use webcam on Chrome browser
View video stream for chrome.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Go Live on Chrome Camera</title>
</head>
<style>
@rmar72
rmar72 / video stream for edge.html
Created Dec 20, 2018
Minimal code to use webcam on Edge browser
View video stream for edge.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Go Live on Edge Camera</title>
</head>
<style>
You can’t perform that action at this time.