Skip to content

Instantly share code, notes, and snippets.

@jchernan
jchernan / SampleAVAudioSessionInterruptionNotification-v2.swift
Created March 3, 2015 02:43
Sample usage of AVAudioSessionInterruptionNotification v2
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
@jchernan
jchernan / SampleAVAudioSessionInterruptionNotification.swift
Created October 24, 2014 08:51
Sample usage of AVAudioSessionInterruptionNotification
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
@jchernan
jchernan / vimrc
Last active August 29, 2015 14:06
syntax enable
set vb
"indents
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
@jchernan
jchernan / TPAACAudioConverter_Swift.swift
Created September 18, 2014 15:05
Sample usage of jchernan/TPAACAudioConverter in Swift
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 {
@jchernan
jchernan / TPAACAudioConverter_Objective-C.m
Last active August 29, 2015 14:06
Sample usage of jchernan/TPAACAudioConverter in Objective-C
- (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];
# 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\]\$ "