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. Remove Duplicate Objects from array | |
data = [{block:'234'......},{},{}] | |
data = _.uniqBy(data, function(v){ | |
return v.block + ' ' + v.street_name + ' ' + v.floor_area_sqm + ' ' + v.resale_price + ' ' + v.month + ' ' + v.lease_commence_date + ' ' + v.flat_type; | |
}); | |
// 2. Check whether an input string contains a number in javascript | |
function hasNumber(myString) { | |
return /\d/.test(myString); | |
} |
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
// Needs to tap twice to fire onPress function when keyboard is open - React Native | |
<ScrollView keyboardShouldPersistTaps={"always"}> | |
<GooglePlacesAutocomplete /> | |
</ScrollView> |
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
https://stackoverflow.com/questions/9063176/git-multiple-user-names-for-the-different-projects-within-the-same-system | |
Just use --local instead of --global. In fact, local is the default so you can just do | |
git config user.email [email protected] | |
git config user.name "whatf hobbyist" | |
in one repo, and | |
git config user.email [email protected] | |
git config user.name "whatf at work" |
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 | |
/** | |
* VSP functions and definitions | |
* | |
* @link https://developer.wordpress.org/themes/basics/theme-functions/ | |
* | |
* @package VSP | |
*/ | |
if ( ! function_exists( 'vsp_setup' ) ) : |
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
XAMPP - Port 80 in use by “Unable to open process” with PID 4! 12 | |
Open a CMD prompt as administrator and execute the following command: net stop was /y | |
Run Dialog Box (press keys Win+R) .. then type: services.msc | |
Then search for World Wide Web Publishing Service (WWW-Publishing Service) and Web Deployment Agent Service and stop them. You should also deactivate them. | |
3.Start Apache again with XAMPP :) | |
Link Ref: http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/ | |
https://stackoverflow.com/questions/20558410/xampp-port-80-in-use-by-unable-to-open-process-with-pid-4-12 |
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
Change line 21 in revslider/includes/framework/base-admin.class.php | |
from | |
private static $arrMetaBoxes = ''; //option boxes that will be added to post | |
to | |
private static $arrMetaBoxes = array(); //option boxes that will be added to post |
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 | |
/** | |
* Using $paged redirects /page/2 to page 1 | |
*/ | |
add_filter('redirect_canonical','pif_disable_redirect_canonical'); | |
function pif_disable_redirect_canonical($redirect_url) { | |
if (is_singular()) $redirect_url = false; | |
return $redirect_url; | |
} |
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('acf/settings/google_api_key', function () { | |
return 'your-api-key'; | |
}); |
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 | |
add_filter( 'comment_form_default_fields', 'wpse_62742_comment_placeholders' ); | |
/** | |
* Change default fields, add placeholder and change type attributes. | |
* | |
* @param array $fields | |
* @return array | |
*/ | |
function wpse_62742_comment_placeholders( $fields ) |
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
ol { | |
counter-reset: item; | |
} | |
ol li { | |
display: block; | |
position: relative; | |
} | |
ol li:before { | |
content: counters(item, ".") " "; | |
counter-increment: item; |