How do I generate a key hash for the Facebook SDK On Mac?

I used following steps to generate a Key Hash for my app in facebook: (I am using Mac OSX 10.8) First open a terminal (open a command prompt in windows). Navigate in the terminal to the directory where your Android debug.keystore is stored. Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and … Read more

How to check if multiple array keys exists

Here is a solution that’s scalable, even if you want to check for a large number of keys: <?php // The values in this arrays contains the names of the indexes (keys) // that should exist in the data array $required = array(‘key1’, ‘key2’, ‘key3’); $data = array( ‘key1’ => 10, ‘key2’ => 20, ‘key3’ … Read more

Custom key-sort a flat associative based on another array

Just use array_merge or array_replace. array_merge works by starting with the array you give it (in the proper order) and overwriting/adding the keys with data from your actual array: $customer[‘address’] = ‘123 fake st’; $customer[‘name’] = ‘Tim’; $customer[‘dob’] = ’12/08/1986′; $customer[‘dontSortMe’] = ‘this value doesnt need to be sorted’; $properOrderedArray = array_merge(array_flip(array(‘name’, ‘dob’, ‘address’)), $customer); … Read more

Add public key to known_hosts file

I answered almost similar answer on SuperUser few days ago. The important parts: The format differs There are different host keys (types) on each server (make sure you paste the one that is actually used) There is ssh-keyscan which can create the format for you Otherwise just prefix your key with server IP address (you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)