Skip to content

Instantly share code, notes, and snippets.

@moeiscool
moeiscool / ffmpegToWeb.js
Last active May 1, 2024 12:39
FFMPEG to Web Browser with Express, Socket.IO and JSMPEG
// Shinobi (http://shinobi.video) - FFMPEG H.264 over HTTP Test
// How to Use raw H.264 (Simulated RTSP)
// 1. Start with `node ffmpegToWeb.js`
// 2. Get the IP address of the computer where you did step 1. Example : 127.0.0.1
// 3. Open VLC and "Open Network Stream".
// 4. Input the following without quotes : `http://127.0.0.1:8001/h264` and start.
var child = require('child_process');
var io = require('socket.io');
var events = require('events');
@whatsmate
whatsmate / send-pdf-individual.php
Last active April 15, 2024 09:24
Sending a PDF document to a WhatsApp user in PHP
<?php
$INSTANCE_ID = 'YOUR_INSTANCE_ID_HERE'; // TODO: Replace it with your gateway instance ID here
$CLIENT_ID = "YOUR_CLIENT_ID_HERE"; // TODO: Replace it with your Premium client ID here
$CLIENT_SECRET = "YOUR_CLIENT_SECRET_HERE"; // TODO: Replace it with your Premium client secret here
$pathToDocument = "/tmp/your_doc.pdf"; // TODO: Replace it with the path to your document
$docData = file_get_contents($pathToDocument);
$base64Doc = base64_encode($docData);
$fn = "anyname.pdf"; // TODO: Replace it with a name you like
$caption = "You will find the map handy."; // caption is optional; can be empty