Skip to content

Instantly share code, notes, and snippets.

View SwapnanilDhol's full-sized avatar
🏠
Working from home

Swapnanil Dhol SwapnanilDhol

🏠
Working from home
View GitHub Profile
@DougGregor
DougGregor / concurrent_merge_sort_algorithm_club.swift
Created December 12, 2020 06:09
Concurrent merge sort ported from the Swift Algorithm Club site
// Ported from https://www.raywenderlich.com/741-swift-algorithm-club-swift-merge-sort
func mergeSort<T: Comparable>(_ array: [T]) async -> [T] {
guard array.count > 1 else { return array }
let middleIndex = array.count / 2
async let leftArray = await mergeSort(Array(array[0..<middleIndex]))
async let rightArray = await mergeSort(Array(array[middleIndex..<array.count]))
return merge(await leftArray, await rightArray)
@Priva28
Priva28 / GradientEffect.swift
Last active December 1, 2023 04:43
Gradient effect to emulate Apple Music Lyrics/Now Playing screen.
//
// ContentView.swift
// GradientEffect
//
// Created by Christian Privitelli on 18/7/20.
//
import SwiftUI
struct ContentView: View {