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 | |
| class CFunctions | |
| { | |
| public function __construct () | |
| { | |
| add_action('init', [$this, 'rewrite_rule_cpost']); | |
| } | |
| public function rewrite_rule_cpost() | |
| { |
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
| <div> | |
| <a href="#" class="spoiler-trigger active"><span>Спойлер 1</span></a> | |
| <div class="spoiler-block" style="display:block;">Открытый контент первого спойлера</div> | |
| </div> |
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 | |
| $fileName = $_FILES['afile']['name']; | |
| $fileType = $_FILES['afile']['type']; | |
| $fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
| $dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
| $json = json_encode(array( | |
| 'name' => $fileName, | |
| 'type' => $fileType, | |
| 'dataUrl' => $dataUrl, |
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 | |
| class NewPostType | |
| { | |
| const LABEL = 'label'; | |
| const LABELS = 'labels'; | |
| const VALUE = 'value'; | |
| const DESCRIPTION = 'description'; | |
| const TYPE = 'type'; | |
| const BACK_DOMAIN = 'art-fields'; |
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
| * { | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing: border-box; | |
| box-sizing: border-box; | |
| } | |
| *:before, | |
| *:after { | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing: border-box; | |
| box-sizing: border-box; |
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 | |
| /** | |
| * @file https://gist.github.com/max-dark/f39028cc106ed32e8ce1b55a11643b43 | |
| */ | |
| define('ROOT_NODE', null); | |
| /** | |
| * восстанавливает дерево по таблице связей | |
| * @param array $data |
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
| # | |
| # Sources: | |
| # http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites | |
| # http://codex.wordpress.org/Output_Compression | |
| # http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086 | |
| # http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/ | |
| # http://gtmetrix.com/configure-entity-tags-etags.html | |
| # http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014 | |
| # http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress | |
| # https://andreashecht-blog.de/4183/ |
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 tabs() { | |
| $('.tabs-block').on('click', '.nav-link', function (event) { | |
| event.preventDefault(); | |
| let $this = $(this), | |
| href = $this.attr('href'); | |
| if ($(href).length) { | |
| $('.tabs-link a').removeClass('active'); | |
| $this.addClass('active'); | |
| $('.tabs-content .tab-content__inner').removeClass('active'); |
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 upload(url, data) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.withCredentials = true; | |
| xhr.onload = xhr.onerror = function() { | |
| if (this.status == 200) { | |
| console.log("success"); | |
| } else { | |
| console.log("error " + this.status); |