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 | |
/** | |
* @author Michael Calcinai <michael@calcin.ai> | |
*/ | |
class IteratorPropertySorterIterator implements \Iterator | |
{ | |
/** | |
* @var \Iterator[] |
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 | |
include __DIR__.'/../vendor/autoload.php'; | |
use Calcinai\PHPi\Peripheral\SPI; | |
use Calcinai\PHPi\Pin\PinFunction; | |
use Calcinai\PHPi\External\ADC\Microchip\MCP3008; | |
$board = \Calcinai\PHPi\Factory::create(); |
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 | |
$xero = new PrivateApplication($config); | |
/** @var Contact[] $contacts */ | |
$contacts = $xero->load('Accounting\\Contact')->execute(); | |
foreach($contacts as $contact){ | |
//do something here | |
//this will give you the raw data without the object structure |
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 | |
public function getAggregateReadings(\DateTime $from, \DateTime $to, \DateInterval $interval) { | |
$from = clone $from; | |
$to = clone $to; | |
$seconds = date_create('@0')->add($interval)->getTimestamp(); | |
//Round to the correct block. |