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
cd vvv/www/wordpress-default | |
cd /users/danielpataki/vvv/www/wordpress-default |
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
function form( $instance ) { | |
$title = ( empty( $instance['title'] ) ) ? '' : $instance['title']; | |
$director = ( empty( $instance['director'] ) ) ? '' : $instance['director']; | |
?> | |
<p> | |
<label for="<?php echo $this->get_field_name( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> | |
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> | |
</p> |
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
function __construct( $config ) { | |
$this->providers = $config['providers']; | |
$this->provider = $config['provider']; | |
// Actions and filters here | |
} |
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
// Cut text down to required length | |
function get_chirp_text( $text ) { | |
return substr( $text, 0, 200 ); | |
} | |
// Parse hashtags from text | |
function get_hashtags( $text ) { | |
preg_match_all("/S*#((?:\[[^\]]+\]|\S+))/", $text, $matches); | |
return $matches; | |
} |
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
(function($) { | |
$(document).on( 'click', '.love-button img', function(){ | |
alert('Love is being given'); | |
}) | |
})( jQuery ); |
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
function my_enqueue($hook) { | |
if ( 'edit.php' != $hook ) { | |
return; | |
} | |
wp_enqueue_script( 'my_custom_script', plugin_dir_url( __FILE__ ) . 'myscript.js' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'my_enqueue' ); |
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
jQuery('.post .entry-title').addClass('better-entry-title') |
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
function Tweet( text, username ) { | |
this.text = text; | |
this.username = username; | |
this.display = function() { | |
return this.text + ' - ' + this.username; | |
} | |
} | |
var tweet_1 = new Tweet( 'I love dogs, they are awesome!', '@danielpataki' ), | |
var tweet_2 = new Tweet( 'Coconut juice is the best thing to drink.', '@danielpataki' ), |
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
var animals = [ "dog", "cat", "bird" ]; | |
console.log( animals.pop() ); // bird | |
console.log( animals ) // dog, cat |
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
cp /etc/hosts ~/hosts.txt |