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
<?php | |
class SoundcloudAPI | |
{ | |
protected $clientID; | |
function __construct() { | |
$this->clientID = "69b6a6bc4f7d483fd21b170137a9cd51"; | |
} | |
function GetTrackLink($id) | |
{ |
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
add_filter( 'user_can_richedit', 'disable_for_cpt' ); | |
function disable_for_cpt( $default ) { | |
global $post; | |
if ( 'movie' == get_post_type( $post ) ) | |
return false; | |
return $default; | |
} |
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
add_action( 'post_submitbox_misc_actions', 'article_or_box' ); | |
add_action( 'save_post', 'save_article_or_box' ); | |
function article_or_box() { | |
global $post; | |
if (get_post_type($post) == 'post') { | |
echo '<div class="misc-pub-section misc-pub-section-last" style="border-top: 1px solid #eee;">'; | |
wp_nonce_field( plugin_basename(__FILE__), 'article_or_box_nonce' ); | |
$val = get_post_meta( $post->ID, '_article_or_box', true ) ? get_post_meta( $post->ID, '_article_or_box', true ) : 'article'; | |
echo '<input type="radio" name="article_or_box" id="article_or_box-article" value="article" '.checked($val,'article',false).' /> <label for="article_or_box-article" class="select-it">Article</label><br />'; | |
echo '<input type="radio" name="article_or_box" id="article_or_box-box" value="box" '.checked($val,'box',false).'/> <label for="article_or_box-box" class="select-it">Box</label>'; |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
# built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class | |
classes/ |
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
// Add listener so your activity gets called back upon completion of action, | |
// in this case with ability to get handle to newly added contact | |
myActivity.addActivityListener(someActivityListener); | |
Intent intent = new Intent(Intent.ACTION_INSERT); | |
intent.setType(ContactsContract.Contacts.CONTENT_TYPE); | |
// Just two examples of information you can send to pre-fill out data for the | |
// user. See android.provider.ContactsContract.Intents.Insert for the complete | |
// list. |
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
<?php | |
// make api call | |
$response = (new FacebookRequest( | |
$session, 'POST', '/me/feed', array( | |
'name' => 'Facebook API: Posting a Status Update Using PHP SDK 4.0.x', | |
'caption' => "I'm rewriting old tutorials to work with the new PHP SDK 4.0 and Graph API 2.0.", | |
'link' => 'https://muatocroi.com', | |
'message' => 'Check out my new tutorial' | |
) |
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
<?php | |
class Curl { | |
/** | |
* cURL request method | |
* | |
* @var string | |
*/ | |
protected $_method = 'GET'; |