View cd.sh
cd vvv/www/wordpress-default | |
cd /users/danielpataki/vvv/www/wordpress-default |
View form.php
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> |
View adding-provider.php
function __construct( $config ) { | |
$this->providers = $config['providers']; | |
$this->provider = $config['provider']; | |
// Actions and filters here | |
} |
View chirp-basic.php
// 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; | |
} |
View action.js
(function($) { | |
$(document).on( 'click', '.love-button img', function(){ | |
alert('Love is being given'); | |
}) | |
})( jQuery ); |
View admin-conditional.php
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' ); |
View addClass.js
jQuery('.post .entry-title').addClass('better-entry-title') |
View constructor.js
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' ), |
View array.pop.js
var animals = [ "dog", "cat", "bird" ]; | |
console.log( animals.pop() ); // bird | |
console.log( animals ) // dog, cat |
View copy.sh
cp /etc/hosts ~/hosts.txt |