Skip to content

Instantly share code, notes, and snippets.

View rwv's full-sized avatar
😴
sleepy...

rwv rwv

😴
sleepy...
View GitHub Profile
@rwv
rwv / dogecoin_icon.svg
Created May 22, 2022 13:33
Doge Coin Icon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rwv
rwv / remove.js
Last active February 7, 2025 02:28
Remove old GitHub Actions artifacts
// Script to delete old GitHub Actions artifacts from the 'user/repo' repository
const githubToken = 'github_pat_xxxxxxx'; // Replace with your GitHub token
const headers = {
'Accept': 'application/vnd.github.v3+json',
'Authorization': `Bearer ${githubToken}`,
'User-Agent': 'ArtifactsCleaner/1.0'
};
@rwv
rwv / write-file-from-stream.ts
Created April 16, 2025 13:13
Tauri wrtie file from ReadableStream
import { writeFile, type WriteFileOptions } from '@tauri-apps/plugin-fs'
export async function writeFileFromStream(
path: string | URL,
stream: ReadableStream<Uint8Array>,
options?: WriteFileOptions & { chunkSize?: number }
) {
const chunkSize = options?.chunkSize ?? 1024 * 1024 // 1MB in bytes
const reader = stream.getReader()