Skip to content

Instantly share code, notes, and snippets.

View kyo504's full-sized avatar
😷
Hope everyone stay safe from COVID-19

Daniel Jung kyo504

😷
Hope everyone stay safe from COVID-19
  • @home
  • Seoul, South Korea
View GitHub Profile
@kyo504
kyo504 / AudioPlayer.swift
Created January 20, 2022 17:41 — forked from netgfx/AudioPlayer.swift
A basic audio player with observers and extra features. Based on AVFoundation and AVQueuePlayer
//
// AudioPlayer.swift
//
// Created by MDobekidis
//
import Foundation
import AVFoundation
import UIKit
import Signals
@kyo504
kyo504 / addObservers.swift
Created January 20, 2022 17:03 — forked from netgfx/addObservers.swift
Add observers to AVPlayer
// listening for current item change
self.audioQueueObserver = self.playerQueue?.observe(\.currentItem, options: [.new]) {
[weak self] (player, _) in
print("media item changed...")
}
// listening for current item status change
self.audioQueueStatusObserver = self.playerQueue?.currentItem?.observe(\.status, options: [.new, .old], changeHandler: {
(playerItem, change) in
if playerItem.status == .readyToPlay {
@kyo504
kyo504 / Common-Currency.json
Created April 9, 2020 23:07 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@kyo504
kyo504 / pr.md
Created March 28, 2017 01:51 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: