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 Calls in PHP | |
* | |
* @param string $method The HTTP method (GET or POST) to be used | |
* @param string $url The URL | |
* @param array $data The data should send with POST | |
* @return string Response from the url | |
*/ | |
function CallAPI( $method, $url, $data = false ) { |
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
body { | |
background-color:#424242; | |
} | |
.neon-effect { | |
text-align:center; | |
font-size:40px; | |
margin:20px 0 20px 0; | |
color:#ffffff; | |
text-shadow: 0 0 10px #ffffff, |
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 | |
/** | |
* Powerful method to encrypt or decrypt a plain text string | |
* initialization vector(IV) has to be the same when encrypting and decrypting | |
* | |
* @param string $action: can be 'encrypt' or 'decrypt' | |
* @param string $string: string to encrypt or decrypt | |
* | |
* @return string | |
*/ |
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
UPDATE tableName | |
SET columnName = REPLACE( | |
columnName, | |
'TEXT TO SEARCH FOR', | |
'TEXT TO REPLACE WITH' | |
) |
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
SELECT | |
user_accounts.id, | |
user_accounts.company_name, | |
IFNULL(suppliers.count, 0) AS suppliers, | |
IFNULL(customers.count, 0) AS customers, | |
IFNULL(inventory_transactions.count, 0) AS transactions | |
FROM user_accounts | |
LEFT JOIN (SELECT | |
user_account_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
<?php | |
/** | |
* Check if array has duplicate values | |
* | |
* @param array $array Specific array to check | |
* @return boolean | |
*/ | |
function array_has_duplicate( $array ) { | |
return count( $array ) !== count( array_keys( array_flip( $array ) ) ); |
NewerOlder