Skip to content

Instantly share code, notes, and snippets.

View iamklim's full-sized avatar

Vladyslav Klymenko iamklim

View GitHub Profile

The hook

useScrollPosition.js:

import { useRef, useLayoutEffect } from 'react'

const isBrowser = typeof window !== `undefined`

function getScrollPosition({ element, useWindow }) {
@jamesgathu
jamesgathu / AudioMerge.swift
Last active August 11, 2024 15:34
**Merging Multiple Audio Files in iOS**
/**
provide an array of audio files urls and get them merged
Its important to note that the process is asynchronous and that one would need to show user some sort of a progress indicator
so that the process does not get interupted
- parameter audioFileUrls: an array of audio file urls
- returns String representing the newly merged file or nil for a failure
*/
func mergeAudioFiles(audioFileUrls: [URL]) -> String? {
let composition = AVMutableComposition()