| Resource | Pure | GitHub | DokuWiki |
|---|---|---|---|
| Italic | _{text}_ | _{text}_ | //{text}// |
| Bold | **{text}** | **{text}** | |
| Underline | __{text}__ | ||
| Header | #{1,6} {text} | (={1,6}) {text} (={1,6}) |
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 | |
| /* | |
| * Workaround to release client connection and still running the script | |
| * Thanks to DeveloperGuy2000, crmalibu, logic_earth and printf at | |
| * http://www.sitepoint.com <http://www.sitepoint.com/forums/showthread.php?602206-Any-way-for-PHP-to-tell-apache-to-close-the-connection-with-user-but-still-run-script> | |
| */ | |
| ignore_user_abort ( true ); | |
| set_time_limit ( 0 ); | |
| header ('Content-Type: text/html; charset=UTF-8'); |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| use Symfony\Component\Console\Input; | |
| class app_console extends CI_Controller{ | |
| public function __construct(){ | |
| parent::__construct(); | |
| } | |
| public function doctrine() { | |
| $this->load->database(); |
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 | |
| /** | |
| * @Entity | |
| * @Table(name="sessions", indexes={@index(name="sessions_timestamp", columns={"timestamp"})}) | |
| */ | |
| class Sessions | |
| { | |
| /** | |
| * @Id | |
| * @Column(name="id", type="string", length=40) |
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
| CREATE TABLE doctrine_migration_versions ( | |
| version VARCHAR(255) NOT NULL, | |
| PRIMARY KEY(version) | |
| ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB; |
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 | |
| /* | |
| * thanks to | |
| * - https://stackoverflow.com/questions/3531857/convert-var-dump-of-array-back-to-array-variable | |
| * - https://stackoverflow.com/questions/2853454/php-unserialize-fails-with-non-encoded-characters | |
| */ | |
| function unvar_dump($str) { | |
| if (strpos($str, "\n") === false) { | |
| //Add new lines: | |
| $regex = array( |
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 array_traverse (&$array, $function, $limit=2, $truncate=true) { | |
| foreach ($array as $key => &$value) { | |
| if (is_array($value)) { | |
| if ($limit > 0) { | |
| array_traverse($value, $function, --$limit, $truncate); | |
| } else { | |
| if ($truncate) { | |
| $value = '{truncated}'; | |
| } |
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 | |
| // Thanks to https://stackoverflow.com/questions/1993721/how-to-convert-camelcase-to-camel-case | |
| function str_camel_case($input) { | |
| preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); | |
| $ret = $matches[0]; | |
| foreach ($ret as &$match) { | |
| $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); | |
| } | |
| return implode('_', $ret); | |
| } |
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
| -- local version = _VERSION:match("%d+%.%d+") -- Lua >= 5.2 | |
| module("version", package.seeall) -- Lua 5.1 | |
| version = _VERSION:match("%d+%.%d+") | |
| package.path = 'lua_modules/share/lua/' .. version .. '/?.lua;lua_modules/share/lua/' .. version .. '/?/init.lua;' .. package.path | |
| package.cpath = 'lua_modules/lib/lua/' .. version .. '/?.so;' .. package.cpath |
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 | |
| $date = DateTime::createFromFormat('H:i M. j Y', '14:16 Nov. 04 2017'); | |
| echo $date->format('Y-m-d H:i'); |