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
for (UIView *view in myView.subviews) { | |
[view removeFromSuperview]; | |
} |
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
header('Expires: Mon, 26 Jul 1990 05:00:00 GMT'); | |
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); | |
header('Cache-Control: no-store, no-cache, must-revalidate'); | |
header('Cache-Control: post-check=0, pre-check=0', FALSE); | |
header('Pragma: no-cache'); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>PayPal TLS Tester</title> | |
</head> | |
<body> | |
<h1>PayPal TLS Tester</h1> | |
<?php | |
$curl = curl_init(); |
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
// Documentation: https://paddle.com/docs/api-generate-coupon/ | |
$url = 'https://vendors.paddle.com/api/2.1/product/create_coupon'; | |
$post = (array) array( | |
'vendor_id' => (int) 12345, | |
'vendor_auth_code' => (string) 'abc1234...', | |
'coupon_prefix' => (string) 'TEST-', | |
'num_coupons' => (int) 5, | |
'description' => (string) 'Coupons created via the API.', |
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
function check_email_address($email_address) { | |
if ($email_address !== '') { | |
$result = filter_var($email_address, FILTER_VALIDATE_EMAIL); | |
if ($result === FALSE) { | |
return false; // email address is not valid | |
} else { | |
return true; // email address is valid | |
} | |
} else { |
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('post_thumbnail_html', 'remove_thumbnail_dimensions', 10); | |
add_filter('image_send_to_editor', 'remove_thumbnail_dimensions', 10); | |
add_filter('the_content', 'remove_thumbnail_dimensions', 10); | |
function remove_thumbnail_dimensions($html) { | |
$html = preg_replace('/(width|height)=\"\d*\"\s/', '', $html); | |
return $html; | |
} |
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('save_post', 'create_sitemap'); | |
function create_sitemap() { | |
$items = (array) get_posts(array( | |
'numberposts' => -1, | |
'post_type' => (array) array( | |
(string) 'post', | |
(string) 'page', | |
), | |
'post_status' => (string) 'publish', |
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('save_post', 'create_sitemap'); | |
function create_sitemap() { | |
$items = (array) get_posts(array( | |
'numberposts' => -1, | |
'post_type' => (array) array( | |
(string) 'post', | |
(string) 'page', | |
), | |
'post_status' => (string) 'publish', |
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 | |
if ($_SERVER['SERVER_NAME'] === 'REMOTE_HOST') { | |
// remote host data | |
define('DB_HOST', (string) 'REMOTE_DB_HOST'); | |
define('DB_USER', (string) 'REMOTE_DB_USERNAME'); | |
define('DB_PW', (string) 'REMOTE_DB_PASSWORD'); | |
define('DB_DB', (string) 'REMOTE_DB'); | |
} else { | |
// local host data | |
define('DB_HOST', (string) 'LOCAL_DB_HOST'); |