Skip to content

Instantly share code, notes, and snippets.

@iopanio
iopanio / mpv-clone-current.conf
Last active July 4, 2023 05:33
clone current playing video file by opening another instance of mpv using keyboard shortcut
Shift+c run "/bin/bash" -c "mpv \"${path}]""
Shift+j playlist-next
Shift+k playlist-prev
@iopanio
iopanio / ExcelToList.cs
Created November 7, 2022 12:29
Import excel data to C# as list object
using System;
using OfficeOpenXml;
namespace ExcelToList
{
class Program
{
static void Main(string[] args)
{
string file = @"data.xlsx";
@iopanio
iopanio / chokidar.js
Created January 3, 2022 13:47
fs watcher
// Setup video source folder observer for notifications of new files
var chokidar = require('chokidar');
var watcher = chokidar.watch(config.videoRawFolder, {
persistent: true,
followSymlinks: false,
usePolling: true,
depth: undefined,
interval: 100,
ignorePermissionErrors: false
@iopanio
iopanio / cheerio.js
Last active January 3, 2022 13:55
Parsing HTML elements with Cheerio
const html = await page.evaluate(() => document.body.innerHTML);
const $ = await cheerio.load(html);
const videoElement = $('video').toArray().map(p => {
return $.html(p);
});
const video0 = videoElement[0];
console.log('Video0:', video0);
//<video></video>
const video1 = await page.evaluate(() => document.querySelector('video'));
@iopanio
iopanio / temple.sh
Last active January 3, 2022 13:56 — forked from ncaldwell/mpvthumbselect.sh
Select videos from $pwd using sxiv.
#!/bin/sh
#
# Select videos to watch with mpv from the current directory using sxiv.
#
# Caches screenshots for all the videos in the current directory, and then calls
# sxiv on the cache.
#
# requires: ffmpeg
# sxiv
# mpv