Skip to content

Instantly share code, notes, and snippets.

View spudro228's full-sized avatar
👌
Bussy

Dmitry Smolyakov spudro228

👌
Bussy
  • Russia
View GitHub Profile
@staltz
staltz / introrx.md
Last active May 29, 2024 05:51
The introduction to Reactive Programming you've been missing
@MontealegreLuis
MontealegreLuis / DoctrineTable.php
Last active August 5, 2021 12:44
Pagination and DDD
<?php
namespace Doctrine1\TableGateway;
use \Doctrine_Record as Record;
use \Doctrine_Query as Query;
use \Doctrine1\QuerySpecifications\Specification;
abstract class DoctrineTable
{
protected $record;
@bastman
bastman / build.properties
Created October 8, 2013 16:29
phing example tasks
project.environment.name=local
project.name=${phing.project.name}
dir.build_xml=${project.basedir}
project.host.default=${project.environment.name}.${project.name}.mydomain.com
dir.project=${dir.build_xml}/../../..
@nick-mok
nick-mok / AnObj.php
Last active January 2, 2020 19:06
This is a revision of George Mihailhoff's PHP Anonymous Object Class. I stumbled upon this class as I was looking for a way to attach functions to properties in a stdClass. This is not directly possible as there is no __call function inbuilt. And I found this code on a stackoverflow post that George had answered. However the implementation didn'…
<?php
class AnObj
{
protected $methods = array();
protected $properties = array();
public function __construct(array $options)
{
@sallar
sallar / console-example.php
Created March 27, 2013 19:44
PHP Colored CLI Output Script.
<?php
// Output screenshot:
// http://cl.ly/NsqF
// -------------------------------------------------------
include_once 'console.php';
// ::log method usage
// -------------------------------------------------------
Console::log('Im Red!', 'red');
@Batou99
Batou99 / apue.h
Created April 11, 2011 14:00
apue.h
/* Our own header, to be included before all standard system headers */
#ifndef _APUE_H
#define _APUE_H
#if defined(SOLARIS)
#define _XOPEN_SOURCE 500 /* Single UNIX Specification, Version 2 for Solaris 9 */
#define CMSG_LEN(x) _CMSG_DATA_ALIGN(sizeof(struct cmsghdr)+(x))
#elif !defined(BSD)
#define _XOPEN_SOURCE 600 /* Single UNIX Specification, Version 3 */