Name | Code |
---|---|
Nonfiction | 9002 |
Romance | 9003 |
Travel & Adventure | 9004 |
Arts & Entertainment | 9007 |
Biographies & Memoirs | 9008 |
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 | |
function txtweb_push($app_key,$pub_key,$mobile_hash,$message) { | |
//setup message | |
$message = trim($message); | |
$message = urlencode("<html><head><meta name=\"txtweb-appkey\" content=\"$app_key\" /></head> | |
<body>$message</body></html>"); | |
//Set parameters for post request | |
$fields = "txtweb-message=$message&txtweb-pubkey=$pub_key&txtweb-mobile=$mobile_hash"; |
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
Hi |
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 | |
// Config // | |
// URL | |
$url = "https://playstore-v1.p.mashape.com/app/details?appid=com.whatsapp&lang=en"; | |
// request timeout in seconds | |
$timeout = 10; | |
// Custom headers. X-Mashape-Key is mandatory, you can add more if you want | |
$headers = array( | |
"X-Mashape-Key: zLqjY8Vh5smshYxxxxxxxxxxxxxxxxxxxxtjsnxiwdKfOmYs9g", | |
"Accept: application/json" |
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
# 1. Change owner of /var/www/html directory to apache user, here: www-data | |
sudo chown -R www-data:www-data /var/www/html | |
# 2. Allow Group to edit | |
sudo chmod -R 775 /var/www/html | |
# 3. Add yourself to apache group(www-data) | |
sudo usermod -a -G www-data ${USER} | |
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 | |
function aes256_cbc($data, $key, $iv) | |
{ | |
// padding | |
$blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128,'cbc'); | |
$len = strlen($data); | |
$pad = $blocksize - ($len % $blocksize); | |
$data .= str_repeat(chr($pad), $pad); | |
// encrypting & encoding | |
return base64_encode( mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, $iv) ) ; |
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
# Steps for installing PECL oAuth package on ubuntu | |
apt-get update | |
apt-get install libpcre3 libpcre3-dev php5-dev | |
pecl install -Z oauth |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Excel To Array | |
|-------------------------------------------------------------------------- | |
| Helper function to convert excel sheet to key value array | |
| Input: path to excel file, set wether excel first row are headers | |
| Dependencies: PHPExcel.php include needed | |
*/ | |
function excelToArray($filePath, $header=true){ |
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 | |
$InvoiceService = new QuickBooks_IPP_Service_Invoice(); | |
$Invoice = new QuickBooks_IPP_Object_Invoice(); | |
$Invoice->setDocNumber('st-100002'); // doc number (optional) | |
$Invoice->setTxnDate('2016-02-12'); | |
$Invoice->setCustomerRef( 1 ); // customer Id | |
// Create a New line |
OlderNewer