This file contains 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
import makeDebug from 'debug' | |
const debug = makeDebug('webm') | |
// Parse EBML variable-length integer | |
function parseVInt(buffer: Uint8Array, start: number): { value: number; length: number } { | |
let firstByte = buffer[start] | |
let numBytes = 0 | |
for (let mask = 0x80; mask >= 0x08; mask >>= 1) { |
This file contains 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
/** | |
* Enhanced `toUpperCase` function with improved type inference. | |
* | |
* Traditional methods return a general `string` type. | |
* This version gives a specific uppercase type based on the input. | |
* | |
* E.g., for an input type 'hello', this returns type 'HELLO'. | |
*/ | |
type ToUpperCase<S extends string> = S extends `${infer First}${infer Rest}` |
This file contains 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
/// Converts a slice of signed 16-bit integers to a vector of unsigned 8-bit integers, | |
/// with little-endian byte order. | |
/// | |
/// # Arguments | |
/// | |
/// * `i16s`: A slice of signed 16-bit integers to convert. Each pair of integers represents | |
/// the left and right channel samples of an audio frame. | |
/// | |
/// # Returns | |
/// |
This file contains 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
FROM ubuntu:22.10 | |
RUN apt-get update && apt-get install -y --no-install-recommends wget \ | |
curl \ | |
build-essential \ | |
cmake \ | |
python-pip \ | |
libglib2.0-dev \ | |
libnss3-dev \ | |
libatk1.0-0 \ |
This file contains 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
.PHONY: clean rename video | |
ffmpeg := /mnt/c/Users/roman/Downloads/ffmpeg-4.4-full_build/ffmpeg-4.4-full_build/bin/ffmpeg.exe | |
filename = $(shell ls Front/${mask}* | head -n 1 | cut -d. -f1 | xargs -n 1 basename) | |
front.txt: | |
ls Front/${mask}* | sed "s/.*/file '&'/" > front.txt | |
back.txt: | |
ls Back/${mask}* | sed "s/.*/file '&'/" > back.txt |
This file contains 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
CREATE DEFINER=`mor`@`%` PROCEDURE `move_track_channel`(IN `s_id` INT, IN `s_target` VARCHAR(16), IN `s_index` INT) | |
NO SQL | |
proc:BEGIN | |
SELECT `t_order`,`track_id` INTO @order, @id FROM `r_link` WHERE `unique_id` = s_target; | |
This file contains 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
export interface LockManager { | |
lock(fn: () => Promise<void>): Promise<void> | |
} | |
/** | |
* This is my limited implementation of Locks manager for browsers. | |
* I implemented my own because this technology is experimental yet. | |
* @see https://developer.mozilla.org/en-US/docs/Web/API/LockManager | |
*/ | |
export class NaiveLockManager implements LockManager { |
This file contains 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 knex = require("knex"); | |
const supertest = require("supertest"); | |
const errorConstants = require("@myownradio/independent/constants/error"); | |
const createApp = require("../src/app"); | |
const migrationsDir = `${__dirname}/../../../migrations`; | |
const seedsDir = `${__dirname}/../../../seeds`; | |
const accessToken = | |
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEsImlhdCI6MTUxNjIzOTAyMn0.Fknsf_nSFNdqS9JkFJABEEtMVffv9zR1_nrI2mAVx60"; |
This file contains 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
export function* iterateOverCombinedItems(items) { | |
if (items.length === 0) { | |
return | |
} | |
const [h, ...tail] = items | |
const heads = Array.isArray(h) ? h : [h] | |
for (const head of heads) { |
This file contains 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
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |
NewerOlder