How about this?
<?php
$test_url = @fopen('https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css','r');
if ( $test_url !== false ) {
// Use CDN
function load_external() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', false );
}
add_action( 'wp_enqueue_scripts', 'load_external' );
} else {
// Use local if url is not available
function load_local() {
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome/css/font-awesome.min.css', false, '4.0.3' );
}
add_action( 'wp_enqueue_scripts', 'load_local' );
}
?>
In addition to this, you could add wp_enqueue_script into the functions to do the same with JS.