Pug - это препроцессор HTML и шаблонизатор, который был написан на JavaScript для Node.js.
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
| /* | |
| * Apple - apple.com | |
| * SF Pro Display used on apple.com as of iPhone 7 (RED) launch (March 21st 2017) | |
| usage: | |
| - font-family: "SF Pro Display","SF Pro Icons","Helvetica Neue","Helvetica","Arial",sans-serif; | |
| - known issues: | |
| - Access to Font at 'http://www.apple.com/wss/fonts/SF-Pro-Display/v1/sf-pro-display_bold.woff' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404. | |
| index.html:1 Access to Font at 'http://www.apple.com/wss/fonts/SF-Pro-Display/v1/sf-pro-display_bold.ttf' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404. |
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
| <html> | |
| <head> | |
| <link href="path/to/your/css/animate.css" rel="stylesheet" type="text/css"> | |
| <style> | |
| .hidden { | |
| opacity: 0; | |
| } | |
| .visible { | |
| opacity: 1; | |
| } |
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(window.location.hash){ | |
| $(document).ready(function() { | |
| $(window).scroll(function() { | |
| window.location.hash='#scroll' | |
| }) | |
| }) | |
| window.hashName = window.location.hash; | |
| if(window.hashName!="#sps"){ |
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 | |
| /** | |
| * Plugin Name: REST API - Post list randomize | |
| * Description: Randomize the content list in REST API passing `orderby=rand` as parameter. | |
| * Version: 1.0.0 | |
| * Author: Felipe Elia | Codeable | |
| * Author URI: https://codeable.io/developers/felipe-elia?ref=qGTOJ | |
| */ | |
| /** |
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
| function get_posts_for_pagination() { | |
| $html = ''; | |
| $paged = ( $_GET['page'] ) ? $_GET['page'] : 1; | |
| $post_type = $_GET['posttype']; | |
| if ( empty($post_type) ) { | |
| return ''; | |
| } | |
| if( filter_var( intval( $paged ), FILTER_VALIDATE_INT ) ) { |
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 | |
| // I was getting a lot of "Indexed, though blocked by robots.txt" coverage | |
| // errors on search/ pages from Google. Since robots.txt only prevents | |
| // crawling, not indexing, I will allow crawling and prohibit indexing via | |
| // the "robots" meta tag instead. | |
| function MYTHEME_preprocess_html(&$variables) { | |
| MYTHEME_add_meta_robots_noindex(); | |
| } |
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 | |
| // How to create horizontal tabs programmatically in Drupal 8, requires Field Group module | |
| $form = array(); | |
| $form['my_field'] = array( | |
| '#type' => 'horizontal_tabs', | |
| '#tree' => TRUE, | |
| '#prefix' => '<div id="unique-wrapper">', | |
| '#suffix' => '</div>', | |
| ); | |
| $items = array( |


