Skip to content

Instantly share code, notes, and snippets.

View brianlmoon's full-sized avatar

Brian Moon brianlmoon

View GitHub Profile
@brianlmoon
brianlmoon / gist:1647760
Created January 20, 2012 15:02
Example output from running GearmanManager with do all workers
$ ./pecl-manager.php -c config-single.ini -w ./pecl-worker-classes -vvv
PID Type Message
25968 INFO Loading workers in ./pecl-worker-classes
25969 PROC Helper forked
25969 INFO Loading workers in ./pecl-worker-classes
25968 PROC Started with pid 25968
25970 WORKER Adding server 127.0.0.1
25970 WORKER Adding job Avg
25970 WORKER Adding job Sum
25968 PROC Started child 25970 (Avg,Sum)
@brianlmoon
brianlmoon / gist:1622938
Created January 16, 2012 20:43
Get weeks from a range
<?php
/**
* Given two timestamps returns the Y-m-d ranges for each week within the range.
*
* @param int $start_ts Starting timestamp
* @param int $end_ts Ending timestamp
* @param bool $full_weeks If true, full weeks will be returned meaning
* the start and end will be adjusted to create full weeks
* @return array
@brianlmoon
brianlmoon / gist:1622095
Created January 16, 2012 18:11
Given two timestamps and a integer, returns the Y-m-d range, separated by days of that integer
<?php
/**
* Given two timestamps and a integer, returns the Y-m-d range, separated by days
* of that integer
*
* @param int $start_ts Starting timestamp
* @param int $end_ts Ending timestamp
* @return array
*
* @test