Skip to content

Instantly share code, notes, and snippets.

View piranna's full-sized avatar

Jesús Leganés-Combarro piranna

View GitHub Profile
@midudev
midudev / README.md
Created October 15, 2022 17:52
Transcribe vídeo de YouTube con Whisper e Inteligencia Artificial

Requisitos

Necesitas tener instalado Python 3.9 e instalar la dependencia de Whisper y PyTube:

pip install git+https://github.com/openai/whisper.git
pip install pytube

También necesitas tener instalado ffmpeg. Según tu sistema operativo se instala de esta forma:

@ErickWendel
ErickWendel / websocket-client.js
Last active April 4, 2024 04:42
Pure WebSocket Node.js Server using Native HTTP Module
// make a request
const options = {
port: 1337,
host: 'localhost',
headers: {
'Connection': 'Upgrade',
'Upgrade': 'websocket'
}
};
const protocol = 'http'
@sindresorhus
sindresorhus / esm-package.md
Last active May 7, 2024 08:55
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@gurupras
gurupras / distributed-mediasoup.js
Created May 27, 2020 13:41
mediasoup horizontal scaling
onServerStartup () {
const { serverId, ip } = getServerInfo() // serverId does not change across restarts
this.serverId = serverId
// We don't have any routers or producers (yet). Clear any value that exists in the DB related to our serverId
clearSharedDB(serverId, 'routers')
clearSharedDB(serverId, 'producers')
// Update the DB with our serverId and ip so that others will know how to reach us
registerServerInDB(serverId, ip)
@tjensen
tjensen / ffmpeg_bars_and_tone_stream.sh
Created March 26, 2020 17:09
FFMPEG command for generating a "bars and tone" RTMP live stream
ffmpeg -re \
-f lavfi -i "smptebars=rate=30:size=640x360" \
-f lavfi -i "sine=frequency=1000" \
-vf drawtext="text='%{pts\:hms}':rate=30:x=(w-tw)/2:y=(h-lh)/2:fontsize=48:fontcolor=white:box=1:boxcolor=black" \
-f flv \
-vcodec libx264 -profile:v baseline -pix_fmt yuv420p -preset ultrafast -tune zerolatency -crf 28 \
-acodec aac \
rtmp://streaming-server/live/key
@JC3
JC3 / xvsync.cpp
Created November 3, 2019 22:53
x sync extension system counter list and test
// link to -lX11 -lXext
#include <cstdio>
#include <X11/Xlib.h>
#include <X11/extensions/sync.h>
#include <inttypes.h>
#include <sys/time.h>
#include <unistd.h>
static void testCounterFrequency (Display *display, XSyncSystemCounter *sc) {
@orta
orta / gist:9d932ae27dfa12b44ca4c10775a3eff6
Last active January 19, 2023 03:31
Notes on adding JSDoc -> d.ts support for JS libs

Command to add:

yarn tsc --declaration --emitDeclarationOnly --allowJs --lib es2015 lib/*.js

or via npx

npx -p typescript@next tsc --declaration --emitDeclarationOnly --allowJs --lib es2015 lib/*.js
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@debojyoti
debojyoti / lenovo_ideapad_330_ubuntu.md
Last active October 15, 2023 20:13
Lenovo ideapad 330 (15ARR) ubuntu issues and there solutions

Lenovo ideapad 330 (15ARR) ubuntu issues and their solutions

Issue-1: None of the ubuntu distros are getting installed

Solution: Ubuntu distros lower than 18.10 will not work in this laptop, as minimum kernal version required is 4.18.

So install ubuntu 18.10 / xubuntu 18.10 / lubuntu 18.10 / kubuntu 18.10 in UEFI mode

Issue-2: Wifi is not working

@dmfigol
dmfigol / asyncio_loop_in_thread.py
Last active April 21, 2024 17:32
Python asyncio event loop in a separate thread
"""
This gist shows how to run asyncio loop in a separate thread.
It could be useful if you want to mix sync and async code together.
Python 3.7+
"""
import asyncio
from datetime import datetime
from threading import Thread
from typing import Tuple, List, Iterable