- Go to Digital Ocean
- Create new ubuntu droplet
This file contains hidden or 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
//Constructor | |
var Person = function (name, age){ | |
//private properties | |
var priv = {}; | |
//Public properties | |
this.name = name; | |
this.age = age; | |
//Public methods |
Sublime Text includes a command line tool, subl
, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.
- Sublime text 2 or 3 installed in your system within
Applications
folder
Setup
This file contains hidden or 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 | |
/** | |
* Set the content width in pixels, based on the theme's design and stylesheet. | |
* | |
* Priority 0 to make it available to lower priority callbacks. | |
* | |
* @global int $content_width | |
*/ | |
function bookmark_content_width() { | |
$GLOBALS['content_width'] = apply_filters( 'bookmark_content_width', 800 ); |
This file contains hidden or 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 .large class to the <p> parent of images wider than 680px. | |
$( '.entry-content img' ).each( function() { | |
var $this = $( this ); | |
if ( ( $this.attr( 'width' ) > 680 ) && ( $this.parent().is( 'p' ) ) ) { | |
$this.parent().addClass( 'large' ); | |
} | |
}); |
This file contains hidden or 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
/** | |
* Remove empty <p> tags. | |
* | |
* See: http://stackoverflow.com/questions/27781798/wordpress-retain-formatting-when-calling-extended-content#comment43990361_27782619 | |
* This seems to be the easiest solution. Remove this function if this ever gets fixed. | |
* Credits: http://stackoverflow.com/questions/6092855/how-do-i-remove-empty-p-tags-with-jquery | |
*/ | |
( function( $ ) { | |
$( 'p' ).each( function() { |
This file contains hidden or 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
if ( ! function_exists( 'magnumopus_featured_image' ) ) : | |
/** | |
* Displays a featured image at the top of single posts and pages and pages with a portfolio or front page template. | |
* | |
* @since Magnum_Opus 1.0.0 | |
*/ | |
function magnumopus_featured_image() { | |
// Return if it's not home and there is no featured image. | |
if ( ! is_home() && ! has_post_thumbnail() ) { | |
return; |
This file contains hidden or 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
if ( ! function_exists( 'genius_portfolio_url' ) ) : | |
/** | |
* Echo a read more url for the portfolio page if the total posts is higher dan the displayed posts. | |
*/ | |
function genius_portfolio_url() { | |
// Return if the post limit is more than total posts. | |
$post_limit = get_theme_mod( 'genius_portfolio_limit', 9 ); | |
$total_posts = wp_count_posts( 'jetpack-portfolio' )->publish; | |
if ( $post_limit > $total_posts ) { |
NewerOlder