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 | |
| function cut_on_nearest_word_at($string, $length = 150) { | |
| $start = grapheme_substr($string, 0, $length); | |
| $byte_offset = strlen($start); | |
| $ubrk = IntlBreakIterator::createWordInstance(ini_get('intl.default_locale')); | |
| $ubrk->setText($string); | |
| $byte_offset = $ubrk->preceding($byte_offset); | |
| return substr($string, 0, $byte_offset); | |
| } |
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
| ########## Private ########## | |
| # From Source/cmInstallGenerator.cxx: | |
| # std::string cmInstallGenerator::GetInstallDestination() const | |
| # { | |
| # std::string result; | |
| # | |
| # if(!this->Destination.empty() && !cmSystemTools::FileIsFullPath(this->Destination.c_str())) { | |
| # result = "${CMAKE_INSTALL_PREFIX}/"; | |
| # } |
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 | |
| require_once(__DIR__ . '/geshi.php'); | |
| class GeshiExtendedHTMLRender extends \Sundown\Render\HTML | |
| { | |
| public function blockCode($code, $language) | |
| { | |
| if (!$language) { | |
| return '<pre><code>' . htmlspecialchars($code, NULL, 'UTF-8') . '</code></pre>'; | |
| } |
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
| cmake_minimum_required(VERSION 2.8) | |
| set(public_debug_namespace "DEBUG_") | |
| set(private_debug_namespace "_${public_debug_namespace}") | |
| set( | |
| "${public_debug_namespace}_source_properties" | |
| ABSTRACT | |
| COMPILE_DEFINITIONS | |
| COMPILE_DEFINITIONS_<CONFIG> |
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
| bool is_file_on_ram(const char *path) | |
| { | |
| #ifdef HAVE_STATFS | |
| # ifdef BSD | |
| # include <sys/param.h> | |
| # include <sys/mount.h> | |
| # else | |
| # include <sys/vfs.h> | |
| # include <linux/magic.h> |
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
| #include <stdio.h> | |
| #define icu_error(status, function) \ | |
| fprintf(stderr, "ICU Error \"%s\" from " function "()\n", u_errorName(status)) | |
| #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) | |
| #define USTRING_SIZE(array) ARRAY_SIZE(array) | |
| #define USTRING_LENGTH(array) (USTRING_SIZE(array) - 1) | |
| #include <unicode/ustdio.h> |
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 | |
| $in = '\u0041\U00000062'; | |
| $out = transliterator_create('Hex-Any')->transliterate($in); | |
| var_dump($out); # string(2) "Ab" |
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 | |
| namespace Julp; | |
| if (isset($_SERVER['PHP_ENV']) && $_SERVER['PHP_ENV'] == 'development' && function_exists('ob_tidyhandler')) { | |
| /* | |
| tidy.default_config is: | |
| indent: true | |
| indent-spaces: 4 | |
| output-xhtml: yes | |
| wrap: 0 |
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 | |
| namespace Julp; | |
| if (isset($_SERVER['PHP_ENV']) && $_SERVER['PHP_ENV'] == 'development' && function_exists('ob_tidyhandler')) { | |
| /* | |
| tidy.default_config is: | |
| indent: true | |
| indent-spaces: 4 | |
| output-xhtml: yes | |
| wrap: 0 |
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 DependenciesManager | |
| { | |
| const NOT_VISITED = 1; | |
| const IN_PROGRESS = 2; | |
| const VISITED = 3; | |
| private $_nodeStates = array(); | |
| private $_names = array(); | |
| private $_relatedNames = array(); |