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 a Language (multi) select field to Buddypress xProfile fields. | |
You can adapt it to any other type of select field, for example one with list of Countries, Cities, etc... | |
Add the following to /wp-content/plugins/bp-custom.php and then visit /wp-admin/users.php?page=bp-profile-setup | |
Read more about bp-custom.php at the official Buddypress https://codex.buddypress.org/themes/bp-custom-php/ | |
*/ | |
function bp_add_languages_xprofile_select_field() { |
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
$.fn.select2.amd.define('select2/data/extended-ajax',['./ajax','./tags','../utils','module','jquery'], function(AjaxAdapter, Tags, Utils, module, $){ | |
function ExtendedAjaxAdapter ($element,options) { | |
//we need explicitly process minimumInputLength value | |
//to decide should we use AjaxAdapter or return defaultResults, | |
//so it is impossible to use MinimumLength decorator here | |
this.minimumInputLength = options.get('minimumInputLength'); | |
this.defaultResults = options.get('defaultResults'); | |
ExtendedAjaxAdapter.__super__.constructor.call(this,$element,options); |
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 your own functions here. You can also copy some of the theme functions into this file. | |
* Wordpress will use those functions instead of the original functions then. | |
*/ | |
function mytheme_enqueue_styles() { | |
wp_register_style('googleFonts', '//fonts.googleapis.com/css?family=Roboto+Condensed:400,700'); | |
wp_enqueue_style( 'googleFonts'); |
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
# !/bin/bash | |
# NB: First install nscd with sudo apt-get install nscd | |
# run this command to flush dns cache: | |
sudo /etc/init.d/dns-clean restart | |
# or use: | |
sudo /etc/init.d/networking force-reload | |
# Flush nscd dns cache: | |
sudo /etc/init.d/nscd restart | |
# If you wanted to refresh your settings you could disable and then run | |
sudo service network-manager restart |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |