Substack https://aljamal.substack.com/p/homoiconic-python
atom=lambda x:not isinstance(x,list)
eq=lambda x,y:x == y
car=lambda x:x[0]
cdr=lambda x:x[1:]
Substack https://aljamal.substack.com/p/homoiconic-python
atom=lambda x:not isinstance(x,list)
eq=lambda x,y:x == y
car=lambda x:x[0]
cdr=lambda x:x[1:]
'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); |
""" | |
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 |
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 |
/* | |
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. |
(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); |
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)
// 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; |
/** | |
* 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 |
#!/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 |