Skip to content

Instantly share code, notes, and snippets.

View jamesgathu's full-sized avatar
🎯
Focusing

James Gathu jamesgathu

🎯
Focusing
View GitHub Profile
@czue
czue / json_tags.py
Last active December 15, 2023 21:41
A simple django template tag that lets you automatically render json from a python object
"""
Usage:
{% load json_tags %}
var = myJsObject = {{ template_var|to_json }};
Features:
- Built in support for dates, datetimes, lazy translations.
@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()