Skip to content

Instantly share code, notes, and snippets.

luchaos / StderrColorFormatter.php
Last active Oct 6, 2021
Monolog StderrColorFormatter using Collision\ConsoleColor
View StderrColorFormatter.php
namespace Luchaos\MonologFormatter;
use Monolog\Formatter\LineFormatter;
use NunoMaduro\Collision\ConsoleColor;
use Psr\Log\LogLevel;
class StderrColorFormatter extends LineFormatter
luchaos / migration.sql
Last active Jan 6, 2017
Laravel Spatie Activity Log for PostGRES
View migration.sql
-- use case: find activities of a resource and/or within its related resources
-- causes sequential scans and is a tad slower because of the explicit json casting:
FROM activity_log
WHERE (log_name = 'resources' AND subject_id = 351030)
OR (log_name = 'related_resources' AND (properties :: JSON -> 'attributes' ->> 'resource_id') :: INT = 351030)
ORDER BY created_at DESC;

Keybase proof

I hereby claim:

  • I am luchaos on github.
  • I am luchaos ( on keybase.
  • I have a public key whose fingerprint is 0C50 5B34 7556 29A9 0FC3 BB2C ECDA 55D3 2195 BD55

To claim this, I am signing this object: