Skip to content

Instantly share code, notes, and snippets.

View jbrahy's full-sized avatar
💭
Lead, follow or get out of the way.

John Brahy jbrahy

💭
Lead, follow or get out of the way.
  • Popular Marketing
  • Long Beach, CA
View GitHub Profile
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
<?php
function is_bot() {
$spiders = array(
"abot",
"dbot",
"ebot",
"hbot",
"kbot",
function netacy_report()
{
$cbs_deal_id = 105;
$report_date = date('Y-m-d', strtotime('yesterday'));
$title = sprintf("CBS Report: %s: %s", $this->get_title($cbs_deal_id), $report_date);
$payable_sql = <<<EOQ
SELECT sum(CASE cbs_entry_post_status_id
WHEN 1 THEN gross
WHEN 2 THEN gross
WHEN 3 THEN gross
@jbrahy
jbrahy / HistoryModel.php
Created March 19, 2024 17:48
current pipeline
function get_message_summary($start_date, $end_date)
{
// get the date range correct
$match_stage = [
'$match' => [
'date_sent' => [
'$gte' => $start_date,
'$lt' => $end_date,
],
function get_message_summary_by_range($start_date, $end_date)
{
// Convert the date to start and end for MongoDB ISODate format
$start_date = new UTCDateTime(new \DateTime($start_date . ' 00:00:00', new DateTimeZone('UTC')));
$end_date = new UTCDateTime(new \DateTime($end_date . ' 23:59:59', new DateTimeZone('UTC')));
// get the date range correct
$match_stage = [
'$match' => [
'date_sent' => [