This file contains 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 | |
class Autoloader | |
{ | |
protected $directory; | |
protected $methodQueue; | |
/** | |
* @param string $dir the directory to look from | |
*/ |
This file contains 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
function bind(f,o) { | |
if(f.bind) return f.bind(o); | |
else return function() { | |
return f.apply(o, arguments); | |
}; | |
} |
This file contains 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
var obj = { | |
method: function(name){ | |
this.name = name; | |
console.log(this.name); | |
var self = this; | |
var inner = function(msg) { | |
console.log(msg + " " + self.name); | |
}; | |
inner('hello'); | |
} |
This file contains 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
var obj = { | |
method: function(name){ | |
this.name = name; | |
console.log(this.name); | |
var inner = function(msg) { | |
console.log(msg + " " + this.name); | |
}.bind(this,'hello'); | |
inner(); | |
} | |
}; |
This file contains 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 | |
namespace Test\Unit\Domain\Repositories; | |
use Domain\Repositories; | |
use Domain\Entities\InputConfig; | |
use Infrastructure\Reflection\Reflection; | |
class IInputConfigRepositoryTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function setUp() { | |
$this->mock = $this->getMockBuilder('Domain\Repositories\IInputConfigRepository') | |
->disableOriginalConstructor() |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using DMSSubscriberUpdate.Domain; | |
using DMSSubscriberUpdate.Infrastructure; | |
using DMSSubscriberUpdate.Domain.Services; | |
namespace DMSSubscriberUpdate | |
{ | |
class Program | |
{ |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace DMSSubscriberUpdate.Domain.Services | |
{ | |
class SubscriberProcessor | |
{ | |
protected Subscriber Subscriber { get; set; } |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace DMSSubscriberUpdate.Domain | |
{ | |
public class Attempt | |
{ | |
public int ChannelID { get; set; } |
This file contains 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 | |
namespace Infrastructure\BinarySocket; | |
class BinarySocket | |
{ | |
protected $socket; | |
public function __construct($ip,$port) | |
{ | |
$this->socket = @socket_create(AF_INET,SOCK_STREAM,SOL_TCP); | |
$connected = @socket_connect($this->socket,$ip,$port); |
This file contains 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
//AOP powers rely on invoke() being used instead of () | |
Function.prototype.invoke = function(args) { | |
if (this.before) { | |
this.before(args); | |
} | |
val = this(args); | |
if (this.after) { | |
this.after(args); | |
} | |
return val; |
OlderNewer