GIT remote show origin
September 15, 2014
git remote show origin displays info for your remote origin repo. I typically use this when I want to get the URL or the remote repo $ git remote show origin * remote origin Fetch URL: git@bitbucket.org:Keenlio/test-repo.git Push URL: git@bitbucket.org:Keenlio/test-repo.git HEAD branch: master Remote branches: iss1903_microsite tracked iss1907_baidu_staticmap tracked iss1910_retailer_map_pic tracked master tracked Local branch […]
PHP delete file in directory
September 15, 2014
If to delete a single file, use the unlink() function. Unlink can safely remove a single file. That function will delete what you pass it as a parameter. For example, delete single file Delete multiple file in a directory, use loop:
PHP check if image file exists
September 12, 2014
File_exists does something weird, it does not say if a file exists, it says if path exists. So, to check if it is a file then you should use is_file together with file_exists to know if there is really a file behind the path, otherwise file_exists will return true for any existing path. Example:
PHP MySql query for random record from database table
September 5, 2014
The simplest way of selecting random rows from the MySQL database is to use “ORDER BY RAND()” clause in the query. Example:
PHP array random value array_rand
September 5, 2014
Returns a set of keys for random entries of array. If you want to pick all entries in a randomized fashion you should be using: ref: http://stackoverflow.com/questions/18046630/php-array-rand-random-value/25678043#25678043
Best way to test if gzinflate process right string
September 2, 2014
If the string is not gzinflated, there will be error throwing. Simple way to test:
Google+ share button popup error Claimed origin not in whitelist
August 25, 2014
Your web origin in the Google API Console should only include http:// or https:// and then the host name. Make sure you don’t have / in the end. The web origin is under the OAuth 2.0 Client ID section in the Console. Remove the ‘/’ at the end of “Javascript Origins” url and solve Example: […]
PHP Cybersource Merchant supplied signature does not match generated signature
August 22, 2014
When this error occur, it means the signed data fields doesn’t matched the supplied post form field or is being left empty. To solve this, make sure each signed data fields are filled up not empty. The PHP sample of Simple Order API & SOAP Toolkit API can be downloaded from here Or refer to […]
Cybersource you are not authorized to view this page. the transaction has not been processed
August 22, 2014
Determine if transaction reaches the gateway. 1. Log into the CyberSource Business Center 2. Navigate to Transaction Search > Secure Acceptance Search. 3. Search for recent activity, If you do not find transaction activity: This means that an authentication failure occurred. To correct this, verify that your Access Key, Secret Key and/or Profile ID with […]
jQuery get which radio is selected
August 22, 2014
Use the :checked selector along with the radio selector. With form id, can do this Without form is, it will still work:
Recent Comments