Skip to content

Instantly share code, notes, and snippets.

View mtdowling's full-sized avatar

Michael Dowling mtdowling

View GitHub Profile
@mtdowling
mtdowling / cron-mondays.php
Created January 16, 2012 18:34
get the next 5 mondays from now using cron expression
<?php
// See https://github.com/mtdowling/cron-expression
require 'cron.phar';
$totalWeeks = 5;
$fromDate = 'now';
$cron = Cron\CronExpression::factory('0 0 * * 1');
$dates = $cron->getMultipleRunDates($totalWeeks, $fromDate);
@mtdowling
mtdowling / guzzle_async_curl_with_mock.php
Created January 15, 2012 16:49
Guzzle: async curl requests with mocked responses
<?php
include 'guzzle.phar';
use Guzzle\Http\Client;
use Guzzle\Http\Message\Response;
use Guzzle\Http\Plugin\BatchQueuePlugin;
use Guzzle\Http\Plugin\MockPlugin;
$client = new Client('http://www.test.com/');