Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<style> | |
.square, | |
.landscape { visibility: hidden; } | |
.portrait { visibility: visible; } | |
@media (min-aspect-ratio: 1/1) { | |
.portrait, | |
.landscape { visibility: hidden; } | |
.square { visibility: visible; } |
/** | |
* Load media uploader on pages with our custom metabox | |
*/ | |
jQuery(document).ready(function($){ | |
'use strict'; | |
// Instantiates the variable that holds the media library frame. | |
var metaImageFrame; |
<?php | |
function delete_custom_posts($post_type = 'post'){ | |
global $wpdb; | |
$result = $wpdb->query( | |
$wpdb->prepare(" | |
DELETE posts,pt,pm | |
FROM wp_posts posts | |
LEFT JOIN wp_term_relationships pt ON pt.object_id = posts.ID | |
LEFT JOIN wp_postmeta pm ON pm.post_id = posts.ID | |
WHERE posts.post_type = %s |
// Create a new object for custom validation of a custom field. | |
var nameSpaceController = Marionette.Object.extend( { | |
initialize: function() { | |
this.listenTo( nfRadio.channel( 'form' ), 'render:view', this.doCustomStuff ); | |
}, | |
doCustomStuff: function( view ) { | |
var formModel = view.model; // formModel will be a Backbone model with all of our form data. | |
var formID = formModel.get( 'id' ); // We can use .get( 'setting' ) get get any of our form settings. |
// child: jquery object e.g $(".active .slide-caption") | |
// parent: jquery object e.g $(".active.slide") | |
// property (string): CSS property to change depending on your CSS positioning e.g. "top", "margin-top" or "bottom" | |
function centerVertical(child, parent, property) { | |
var parentHeight = parent.height(), | |
childHeight = child.height(); | |
// Handle edge cases with padding or margins affecting child.height() calculation | |
if (child.find("h1").length) { |
/* | |
* Add custom user profile information | |
* | |
*/ | |
add_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
function my_show_extra_profile_fields( $user ) { ?> |
<?php | |
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island |