This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func addInterruptionNotification() { | |
// add audio session interruption notification | |
NSNotificationCenter.defaultCenter().addObserver(self, | |
selector: "handleInterruption:", | |
name: AVAudioSessionInterruptionNotification, | |
object: nil) | |
} | |
func handleInterruption(notification: NSNotification) { | |
if notification.name != AVAudioSessionInterruptionNotification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func addInterruptionNotification() { | |
// add audio session interruption notification | |
NSNotificationCenter.defaultCenter().addObserver(self, | |
selector: "handleInterruption:", | |
name: AVAudioSessionInterruptionNotification, | |
object: nil) | |
} | |
func handleInterruption(notification: NSNotification) { | |
if notification.name != AVAudioSessionInterruptionNotification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax enable | |
set vb | |
"indents | |
set shiftwidth=2 | |
set tabstop=2 | |
set softtabstop=2 | |
set expandtab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func convertAudio() -> Bool { | |
var success = false | |
var error: NSError? | |
let session = AVAudioSession.sharedInstance() | |
let sourcePath = "<source>" | |
let destinationPath = "<destination>" | |
// set category of audio session | |
success = session.setCategory(AVAudioSessionCategoryPlayback, | |
error: &error) | |
if !success { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)convertAudio | |
{ | |
BOOL success = NO; | |
NSError *error = nil; | |
AVAudioSession *session = [AVAudioSession sharedInstance]; | |
NSString *sourcePath = @"<source>" | |
NSString *destinationPath = @"<destination>" | |
// set category of audio session | |
success = [session setCategory:AVAudioSessionCategoryPlayback error:&error]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git | |
export PATH=/usr/local/git/bin:$PATH | |
# curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh | |
# curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash | |
source ~/.git-prompt.sh | |
source ~/.git-completion.bash | |
# Command prompt | |
PS1="\u:\W\[\e[0;36m\]\$(__git_ps1)\[\e[m\]\$ " |