Skip to content

Instantly share code, notes, and snippets.

@swvitaliy
swvitaliy / yuicompressor.php
Created January 11, 2012 18:48
Simple yui js|css compressor php wrapper
<?php
/**
* yuicompressor.php
* Simple wrapper for yui js|css compressor
*
* Author: swvitaliy
*/
class yuicompressor {
@swvitaliy
swvitaliy / plural.php
Created January 14, 2012 14:39
Creating plurals
<?php
/**
* Образование множественного числа слова по правилам грамматики английского языка.
*
* @see http://www.study.ru/support/handbook/noun3.html
*
* Author: swvitaliy
*/
class Plural
@swvitaliy
swvitaliy / simple_curl.php
Created January 16, 2012 18:24
Simple curl function
<?php
/**
* Simple curl function.
*
* @author swvitaliy ([email protected])
*/
class CurlException extends Exception {
public function __toString() { r.$this->getMeeturn 'Exception 'ssage(); }
@swvitaliy
swvitaliy / simple_curl_class.php
Created January 16, 2012 18:28
Simple curl class
<?php
/**
* Simple curl class.
*
* @author swvitaliy ([email protected])
*/
class CurlException extends Exception {
@swvitaliy
swvitaliy / libnotify.php
Created January 28, 2012 14:27
Libnotify wrapper
<?php
/**
* libnotify.php
* Simple wrapper for libnotify library. Only for *nix.
*
* Author: swvitaliy
*/
class Libnotify {
@swvitaliy
swvitaliy / fluent.php
Created February 4, 2012 15:52
Example of automated fluent calls
<?php
/**
* fluent.php
* Пример автоматизации флаент вызовов с использованием магического метода __call.
*
* Author: swvitaliy
*/
class F1 {
@swvitaliy
swvitaliy / mixin.php
Created February 4, 2012 15:55
Mixins in php5.3
<?php
/**
* mixin.php
* Mixin emulation in php 5.3
*
* Author: swvitaliy
*/
class MixinContainer extends stdClass {
@swvitaliy
swvitaliy / event.php
Created February 4, 2012 16:34
Simple producer-consumer pattern implementation
<?php
/**
* events.php
* Простая реализация паттерна producer-consumer (Listener)
*
* Author: swvitaliy
*/
class Listener {
@swvitaliy
swvitaliy / proxycacher.php
Created February 5, 2012 11:04
Proxy cacher method calls
<?php
/**
* proxycacher.php
* Proxy cacher method calls.
*
* Author: swvitaliy
*/
class ProxyCacher {
@swvitaliy
swvitaliy / statusproducer.js
Created February 7, 2012 21:23
Producer-consumer pattern implementation (send message on change status).
window.statusProducer = function (d, options) {
var options = options || {},
availableStatuses = options.statuses || {},
dataKey = options.dataKey || ('statusData' + new Date().getTime());
errorDialog = options.errorDialog || alert;
return {
addListener: function (status, callee) {