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
wp core download | |
wp core config --dbname="dbname" --dbuser="dbuser" --dbpass="dbpass" --extra-php <<PHP | |
/* Pressbooks */ | |
define( 'WP_DEFAULT_THEME', 'pressbooks-book' ); | |
define( 'PB_PRINCE_COMMAND', '/usr/bin/prince' ); | |
define( 'PB_KINDLEGEN_COMMAND', '/opt/kindlegen/kindlegen' ); | |
define( 'PB_EPUBCHECK_COMMAND', '/usr/bin/java -jar /opt/epubcheck-3.0.1/epubcheck-3.0.1.jar' ); | |
define( 'PB_XMLLINT_COMMAND', '/usr/bin/xmllint' ); | |
PHP | |
wp core install --url="http://domain.com" --title="Pressbooks" --admin_user="username" --admin_password="password" --admin_email="[email protected]" |
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 | |
$settings=array( | |
/* (string) Unique identifier for the form. Defaults to 'acf-form' */ | |
'id'=>'acf-form', | |
/* (int|string) The post ID to load data from and save data to. Defaults to the current post ID. | |
Can also be set to 'new_post' to create a new post on submit */ | |
'post_id'=>false, | |
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
void main() { | |
List<String> myList = [ | |
'Angela', | |
'James', | |
'Katie', | |
'Jack', | |
]; | |
//print(myList[2]); | |
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 | |
/** | |
* Display thumbs generate by Wordpress' service Mshot and write | |
* locally the thumb after generation to have better loading web performance. | |
* | |
* Thx @jd_ma for help :) | |
*/ | |
function show_and_write_thumbnail ($url, $width=200, $height=150) { |
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 | |
function create_post_your_post() { | |
register_post_type( 'your_post', | |
array( | |
'labels' => array( | |
'name' => __( 'Your Post' ), | |
), | |
'public' => true, | |
'hierarchical' => true, |
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 | |
/** | |
* This shortcode will allow you to create a snapshot of a remote website and post it | |
* on your WordPress site. | |
* | |
* [snapshot url="http://www.wordpress.org" alt="WordPress.org" width="400" height="300"] | |
*/ | |
add_shortcode( 'snapshot', function ( $atts ) { | |
$atts = shortcode_atts( array( |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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
@mixin image-2x($image, $width, $height) { | |
@media (min--moz-device-pixel-ratio: 1.3), | |
(-o-min-device-pixel-ratio: 2.6/2), | |
(-webkit-min-device-pixel-ratio: 1.3), | |
(min-device-pixel-ratio: 1.3), | |
(min-resolution: 1.3dppx) { | |
/* on retina, use image that's scaled by 2 */ | |
background-image: url($image); | |
background-size: $width $height; | |
} |