This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ffmpegTee = (youtube, twitch, facebook) => { | |
| return [ | |
| '-i', | |
| '-', | |
| // select first stream intended for output | |
| '-map', | |
| '0', | |
| // video codec config: low latency, adaptive bitrate | |
| '-c:v', | |
| 'libx264', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ffmpeg = child_process.spawn('ffmpeg', [ | |
| // the input | |
| '-i', | |
| '-', | |
| // video codec config: low latency, adaptive bitrate, | |
| // list of presets: https://trac.ffmpeg.org/wiki/Encode/H.264 | |
| // tune zerolatency is good for fast encoding and low-latency streaming | |
| // g:v 60 ==> https://www.reddit.com/r/ffmpeg/comments/redaa2/while_livestreaming_to_youtube_using_ffmpeg_i_get/ | |
| '-c:v', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <meta charset="utf-8"> | |
| <title>Render the text of a PDF with PDF.js</title> | |
| <style> | |
| .page-container { | |
| box-shadow: 0 1px 3px #444; | |
| position: relative; | |
| font-size: 1px; | |
| line-height: 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A BASIC Node server | |
| // Routing Requests | |
| const http = require("http"); | |
| const url = require("url"); | |
| const server = http.createServer(function(req, res) { | |
| //console.log(req.url); | |
| let parsedURL = url.parse(req.url, true); | |
| let path = parsedURL.pathname; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs") | |
| port = process.argv[2] || 8888, | |
| mimeTypes = { | |
| "html": "text/html", | |
| "jpeg": "image/jpeg", | |
| "jpg": "image/jpeg", | |
| "png": "image/png", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <title>Alpine.js Modal Dialog</title> | |
| <style> | |
| [x-cloak] { | |
| display: none !important; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* global chrome, MediaRecorder, FileReader */ | |
| chrome.runtime.onConnect.addListener(port => { | |
| let recorder = null | |
| port.onMessage.addListener(msg => { | |
| console.log(msg); | |
| switch (msg.type) { | |
| case 'REC_STOP': | |
| console.log('Stopping recording') | |
| if (!port.recorderPlaying || !recorder) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addEventListener('fetch', event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| // Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/ | |
| /** | |
| * Fetch and log a request | |
| * @param {Request} request | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <script type="text/javascript" src="//mozilla.github.io/pdf.js/build/pdf.js"></script> | |
| <script type="text/javascript"> | |
| var url = "https://docs.google.com/document/export?format=pdf&id=1ML11ZyyMpnAr6clIAwWrXD53pQgNR-DppMYwt9XvE6s&token=AC4w5Vg7fSWH1Hq0SgNckx4YCvnGPaScyw%3A1423618416864"; | |
| var pages = [], heights = [], width = 0, height = 0, currentPage = 1; | |
| var scale = 1.5; | |
| function draw() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <script type="text/javascript" src="//mozilla.github.io/pdf.js/build/pdf.js"></script> | |
| <script type="text/javascript"> | |
| var url = "https://docs.google.com/document/export?format=pdf&id=1ML11ZyyMpnAr6clIAwWrXD53pQgNR-DppMYwt9XvE6s&token=AC4w5Vg7fSWH1Hq0SgNckx4YCvnGPaScyw%3A1423618416864"; | |
| var pages = [], heights = [], width = 0, height = 0, currentPage = 1; | |
| var scale = 1.5; | |
| function draw() { |
NewerOlder