Skip to content

Instantly share code, notes, and snippets.

View 66Ton99's full-sized avatar
🇺🇦

Ton Sharp 66Ton99

🇺🇦
View GitHub Profile
@66Ton99
66Ton99 / gist:2844446
Created May 31, 2012 16:08
Swift memory transport
<?php
/**
* Memory Swift maller transport for unit tests
*
* @package Lib
* @subpackage Swift
* @author Ton Sharp <forma@66ton99.org.ua>
*/
class Swift_MemTransport implements Swift_Transport
@66Ton99
66Ton99 / gist:2343223
Created April 9, 2012 12:53
Amazon SQS - Zend_Queue realisation
<?php
/**
* Amazon SQS Queue
*
* @author Ton Sharp <Forma-PRO@66ton99.org.ua>
*/
class Zend_Queue_Adapter_AmazonSQS extends Zend_Queue_Adapter_AdapterAbstract
{
@66Ton99
66Ton99 / addHashToUrl.js
Created December 21, 2011 13:46
Add hash(anchor) to url without scrolling
/**
* Add hash to url without scrolling
*
* @param String $url - it could be hash or url with hash
*
* @return void
*/
function addHashToUrl($url)
{
if ('' == $url || undefined == $url) {
@66Ton99
66Ton99 / ipconfig.sh
Created September 18, 2011 19:02
Ipconfig for Linux
#! /bin/bash
ifconfig
echo
echo Gateway" "Interface
route -n | awk '/UG/ {printf "%-21s %s\n",$2,$8}'
echo
echo DNS Servers
awk '/nameserver/ {print $2}' /etc/resolv.conf
echo
@66Ton99
66Ton99 / sendmail_fake.sh
Created September 18, 2011 18:59
Fake sendmail
#!/bin/sh
prefix="/home/mail"
numPath="$prefix/.num"
if [ ! -f $numPath ]; then
echo "0" > $numPath
chmod 0777 $numPath
fi
num=`cat $numPath`
num=$(($num + 1))
@66Ton99
66Ton99 / chain.php
Created September 18, 2011 18:54
Chain of Responsibility
<?php
class Handler
{
protected $next;
protected $id;
protected $limit;
public function getLimit()
{