Skip to content

Instantly share code, notes, and snippets.

View jakiestfu's full-sized avatar
🌺

Jacob Kelley jakiestfu

🌺
View GitHub Profile
@corysimmons
corysimmons / page.tsx
Created January 26, 2024 17:22
Next.js app router Wavesurfer.js + Tone.js to apply effects and scrub a timeline both in realtime.
'use client'
import React, { useRef, useState, useEffect } from 'react';
import { useWavesurfer } from '@wavesurfer/react';
import * as Tone from 'tone';
export default function Page() {
const containerRef = useRef<HTMLDivElement>(null);
const audioRef = useRef<HTMLAudioElement | null>(null);
const [playing, setPlaying] = useState(false);
const pitchShift = useRef<Tone.PitchShift | null>(null);
@DavidBuchanan314
DavidBuchanan314 / widevine_fixup.py
Last active April 24, 2024 06:24
Patch aarch64 widevine blobs from ChromeOS to work on non-ChromeOS linux, including platforms with 16K page size like Apple Silicon / Asahi Linux
"""
MIT License
Copyright (c) 2023 David Buchanan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@soof-golan
soof-golan / Dockerfile
Last active May 1, 2024 18:15
Python + Poetry + Docker Example
FROM python:3.10 as python-base
# https://python-poetry.org/docs#ci-recommendations
ENV POETRY_VERSION=1.2.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
# Tell Poetry where to place its cache and virtual environment
ENV POETRY_CACHE_DIR=/opt/.cache
@andrewcourtice
andrewcourtice / task.ts
Last active April 21, 2024 09:08
Async cancellation using promise extension and abort controller
/*
This a basic implementation of task cancellation using a Promise extension
combined with an AbortController. There are 3 major benefits to this implementation:
1. Because it's just an extension of a Promise the Task is fully
compatible with the async/await syntax.
2. By using the abort controller as a native cancellation token
fetch requests and certain DOM operations can be cancelled inside the task.
3. By passing the controller from parent tasks to new child tasks an entire
async chain can be cancelled using a single AbortController.
@Supinic
Supinic / essentia-poc.js
Created November 26, 2020 20:31
essentia.js + necrodancer
(async () => {
const essentia = require("essentia.js")
const time = {
start: process.hrtime.bigint()
};
const file = await require("fs").promises.readFile("D:\\pirate gay remake.wav");
time.file = process.hrtime.bigint();
const vector = essentia.arrayToVector(file);
@ruario
ruario / 1-README.md
Last active February 7, 2024 18:46
A script that fetches a ChromeOS image for ARM32 and extracts the Widevine binary, saving it in a compressed archive for use with Vivaldi

The included script 'widevine-flash_armhf.sh' fetches a ChromeOS image for ARM and extracts the Widevine binary, saving it in a compressed archive. Since it downloads a fairly large file (2Gb+ on disk after download) it is recommended that you run the script on a machine that has plenty of disk space.

To install the resultant archive, issue the following on your ARM machine–after copying over the archive if needed:

sudo tar Cfx / widevine-flash-20200124_armhf.tgz

(Where 'widevine-flash-20200124_armhf.tgz' is updated to reflect the actual name of the created archive)

@Airblader
Airblader / interpolate.js
Last active November 29, 2023 16:33
rxjs – Interpolate progress straight from hell
// Use https://rxviz.com to see it in action.
/**
* Interpolates a (numeric) source stream with predicted values based on how
* quickly the source stream's value increases. This was intended to smooth out
* a progress bar, but should one really use this piece of sheer terror in production?
*/
const interpolate = (source$, relax = 50) => {
/* This just allows a shorter syntax, avoiding return statements in arrow functions. */
const id = obj => obj;
@nlac
nlac / splitter.js
Last active March 20, 2024 02:05
A small js snippet to split a merged audio track to parts by silence analysis. Based on ffmpeg "silencedetect" filter and node.js.
/**
* This javascript snippet is able to split a merged audio track to parts by silence analysis
* It is based on ffmpeg (https://ffmpeg.org), especially on the silencedetect filter (https://ffmpeg.org/ffmpeg-filters.html#silencedetect)
*
* Assumptions:
* - nodejs is installed
* - ffmpeg is installed
*
* Usage:
* - fill the options object
@chadmayfield
chadmayfield / hashcat_macos.sh
Created June 2, 2017 17:24
Install Hashcat on macOS
#!/bin/bash
git clone https://github.com/hashcat/hashcat.git
mkdir -p hashcat/deps
git clone https://github.com/KhronosGroup/OpenCL-Headers.git hashcat/deps/OpenCL
cd hashcat/ && make
./hashcat --version
./hashcat -b -D 1,2
./example0.sh
@psobot
psobot / bouncer.py
Last active June 8, 2023 02:42
Logic Pro X Project Bounce script
import os
import sys
import time
import atomac
import subprocess
if len(sys.argv) < 2:
print "Usage: bouncer.py <path_to_logic_project> (<path_to_logic_project>)"
os.exit(1)