This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
this_dir = File.dirname(__FILE__) + "/" | |
require this_dir + "vagrant/hostmaster.rb" | |
Vagrant::Config.run do |config| | |
# define some colors for our output | |
def colorize(text, color_code) "#{color_code}#{text}\033[0m" end |
This file contains hidden or 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
Class IpRange | |
{ | |
public function setStartingAddress($startingAddress) | |
{ | |
InputValidator::assertValidAddress($startingAddress); | |
$this->startingAddress = (int) $startingAddress; | |
return $this; | |
} | |
} |
This file contains hidden or 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 | |
abstract class Helper | |
{ | |
public static function createHash(Paste $paste, PasteService $service) | |
{ | |
$seed = $paste->language . $paste->timestamp . $paste->content; | |
do { | |
$seed . = uniqid(); | |
$hash = hash('sha1', $seed); | |
} while ($service->exists($hash)); |
This file contains hidden or 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 | |
/** | |
* @template <T> The type of the individual elements | |
*/ | |
class ArrayCollection implements IteratorAggregate | |
{ | |
private $elements; | |
/** | |
* @param array<T> $elements |