Skip to content

Instantly share code, notes, and snippets.

@nganphant
nganphant / README.md
Created August 9, 2022 11:24 — forked from moutend/README.md
[Swift] read and write WAV audio file with AVAudioFile

This script reads /tmp/input.wav and writes the copy of input as /tmp/output.wav.

$ swift main.swift
@nganphant
nganphant / README.md
Created June 29, 2022 08:00 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@nganphant
nganphant / Objective-C Code Snippets .h
Created January 17, 2022 12:03 — forked from slow-coding/Objective-C Code Snippets .h
An Objective-C class with useful macros and functions
//
// DZUtility.h
// Utility
//
// Created by Darren Zheng on 13-4-20.
// Copyright (c) 2013年 Darren Zheng. All rights reserved.
//
#import <Foundation/Foundation.h>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleIdentifier</key>
<string>com.YourName.YourAppName</string>
<key>CFBundleVersion</key>
<string>1</string>
/**
Calculate initial compass bearing between two locations
- parameter fromLocation: Source Location
- parameter toLocation: Destination Location
- returns: bearing (CLLocationDirection)
*/
private func bearingFromLocation(fromLocation: CLLocation, toLocation: CLLocation) -> CLLocationDirection {