Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View toresbe's full-sized avatar

Tore Sinding Bekkedal toresbe

View GitHub Profile
@toresbe
toresbe / .editorconfig
Created April 18, 2024 18:58
.editorconfig for ktlint and IntelliJ
[*.{kt,kts}]
max_line_length = off
# If EditorConfig support is enabled in IntelliJ IDEA, the following settings override Code Style settings.
# This is the minimal set to make IDEAs formatter compatible with ktlint.
# The settings here are the equivalent to the settings prescribed in
# https://pinterest.github.io/ktlint/latest/rules/configuration-intellij-idea/
insert_final_newline = true
#!/usr/bin/env bash
ENDPOINT_URL=http://10.102.38.194
S4_ARGS="--endpoint-url $ENDPOINT_URL "
cd /mnt/media
for file in */original/*; do
VIDEO_ID=$(echo "${file}" | cut -f1 -d/)
TARGET_PATH="s3://${BUCKET}/${VIDEO_ID}_O_$(basename "${file}")"
@toresbe
toresbe / withCredentials.ts
Last active November 2, 2022 23:36
Replacing withCredentials in use-tus
import { useTus } from "use-tus"
// withCredentials used to include credentials with use-tus.
// But the documentation to do so isn't totally obvious.
// Discussion: https://github.com/tus/tus-js-client/issues/167#issuecomment-623073224
// Documentation: https://github.com/tus/tus-js-client/blob/14c3634e0ccd45973e90a3e460ca5e749f630107/docs/api.md
const { upload, setUpload } = useTus()
// Before, you could do this: