Skip to content

Instantly share code, notes, and snippets.

View WinterSilence's full-sized avatar
🙃
explore

Anton WinterSilence

🙃
explore
View GitHub Profile
@WinterSilence
WinterSilence / Base.php
Last active January 1, 2016 18:09
Abstract base class, supports magically work with properties. Allows protect tproperties and interact with them only through methods set\get.
<?php
/**
* Abstract base class, supports magically work with properties.
* Allows protect tproperties and interact with them only through methods set\get.
*/
abstract class Base
{
/**
* Get protected property by calling method "getPropertyName" or "propertyName"
* (combines set\get methods). If methods are undefined, get property directly.
@WinterSilence
WinterSilence / Mailer.php
Last active September 5, 2020 09:54
Example Kohana CLI Task
<?php defined('SYSPATH') OR die('No direct script access.');
/**
* Example...
*
* @package Kohana/CLI
* @category Task
* @author Kohana Team
* @copyright (c) 2013-2014 Kohana Team
* @license http://kohanaframework.org/license
*/
@WinterSilence
WinterSilence / Closure.php
Created May 25, 2014 19:31
Class Enso\Closure: used to create serializable anonymous function
<?php
/**
* Used to create serializable anonymous function, based on PHP function
* [create_function](http://php.net/create-function).
*
* @package Enso
* @category Base
* @license http://ensophp.github.io/license
*/
namespace Enso;
@WinterSilence
WinterSilence / ExceptionHandler.php
Last active August 29, 2015 14:11
Enso\Core\ShutdownHandler
<?php
namespace Enso\Core;
/**
* Inline exception handler, displays the error message, source of the exception
* and the stack trace of the error.
*
* @package Enso\Core
* @copyright (c) 2014 WinterSilence
@WinterSilence
WinterSilence / IRequest.php
Last active August 29, 2015 14:11
Enso\Core - routing
<?php
namespace Enso\Core;
/**
* Interface for request.
*
* @package Enso\Core
* @copyright (c) 2014 WinterSilence
* @license MIT License
@WinterSilence
WinterSilence / css-padding-hack.css
Last active September 4, 2020 11:57
CSS padding hack for create block with responsive square image
/* Example:
<div class="thumbnail">
<div class="square-box">
<a href="#"><img src="..." class="img-responsive" alt="..."></a>
</div>
</div>
*/
.square-box {
display: table;
<?php
/**
* A general-purpose implementation that includes the optional functionality
* of allowing multiple base directories for a single namespace prefix.
*/
class Psr4Autoloader
{
const EXTENSION = '.php';
/**
* An associative array where the key is a namespace prefix and the value
@WinterSilence
WinterSilence / Sitemap.php
Last active May 6, 2016 09:41
Sitemap refactoring
<?php
namespace Sitemap;
/**
* A class for generating sitemaps.
* @see http://sitemaps.org
*/
class Sitemap
{
/**
@WinterSilence
WinterSilence / Sitemap\Url.php
Last active January 31, 2020 17:18
Version of Sitemap\Url
<?php
namespace Sitemap;
/**
* Basic sitemap URL class.
*/
class Url extends UrlAbstract
{
/**
* Valid values of "changefreq" element.
@WinterSilence
WinterSilence / waExtendedPlugin.class.php
Last active January 23, 2022 07:12
Extended plugin for Webasyst framework
<?php
/**
* Extended plugin for Webasyst framework.
*/
abstract class waExtendedPlugin extends waPlugin
{
/**
* @var waSystem
*/