Gone are the days of simple text-based comments in Github!


| "postcssSorting.config": { | |
| "order": [ | |
| "custom-properties", | |
| "dollar-variables", | |
| "at-rules", | |
| "declarations", | |
| { | |
| "type": "at-rule", | |
| "name": "media" | |
| }, |
| <?php | |
| // NOTE: It would normally be recommended to split a block's JavaScript | |
| // implementation to a separate file, but is authored here in a single | |
| // file for convenience's sake. | |
| // | |
| // See: https://github.com/WordPress/gutenberg/pull/2791 | |
| /** | |
| * Plugin Name: Stars Block |
| replace your my-first-custom-element.php with code below. |
Install software-properties-common
sudo apt-get install software-properties-common
Add Repo
sudo add-apt-repository ppa:olipo186/git-auto-deploy
| // Shortcode | |
| // source : https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524362 | |
| if(!function_exists('carousel_content')){ | |
| function carousel_content( $atts, $content = null ) { | |
| return '<div class="owl-carousel content-carousel content-slider">'.do_shortcode($content).'</div>'; | |
| } | |
| add_shortcode('carousel_content', 'carousel_content'); | |
| } |
This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.
It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)
Gists don't let you specify full paths, so in the project structure the files would be:
routes-index.js --> /routes/index.js // modified to add the api endpoints
routes-api-posts.js --> /routes/api/posts.js // new file containing the Post API route controllers
| // Get The Page ID You Need | |
| get_option( 'woocommerce_shop_page_id' ); | |
| get_option( 'woocommerce_cart_page_id' ); | |
| get_option( 'woocommerce_checkout_page_id' ); | |
| get_option( 'woocommerce_pay_page_id' ); | |
| get_option( 'woocommerce_thanks_page_id' ); | |
| get_option( 'woocommerce_myaccount_page_id' ); | |
| get_option( 'woocommerce_edit_address_page_id' ); | |
| get_option( 'woocommerce_view_order_page_id' ); | |
| get_option( 'woocommerce_terms_page_id' ); |
| <?php | |
| /* | |
| Plugin Name: Pug Bomb API Endpoint | |
| Description: Adds an API endpoint at /api/pugs/$n_pugs | |
| Version: 0.1 | |
| Author: Brian Fegter | |
| Author URL: http://coderrr.com | |
| */ | |
| class Pugs_API_Endpoint{ |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |