Skip to content

Instantly share code, notes, and snippets.

View yhoyoex's full-sized avatar
🏠
Working from home

Bayu Trisnapati yhoyoex

🏠
Working from home
  • Fifty Two.corp
  • Novara, Italy
View GitHub Profile
@yhoyoex
yhoyoex / laravel-socket-io.md
Created August 1, 2021 19:21 — forked from brainlagid/laravel-socket-io.md
Setup Laravel with Socket.io [Ubuntu 20.04]

Server Requirement

  • Redis sudo apt install redis-server
  • Composer here
  • npm sudo apt install nodejs npm
  • laravel-echo-server npm install -g laravel-echo-server

Laravel Dependencies Requirement

  • predis
  • laravel-echo
  • socket.io-client ^2.4.0 issue
function preprocessImage(canvas) {
const ctx = canvas.getContext('2d');
const image = ctx.getImageData(0,0,canvas.width, canvas.height);
blurARGB(image.data, canvas, 1);
dilate(image.data, canvas);
invertColors(image.data);
thresholdFilter(image.data, 0.4);
return image;
}