Skip to content

Instantly share code, notes, and snippets.

@zzgael
zzgael / AssociationEnum.php
Last active May 7, 2024 16:25
HubSpot Repository
<?php namespace App;
enum AssociationEnum: int
{
case CONTACT_TO_COMPANY = 1;
case DEAL_TO_CONTACT = 3;
case DEAL_TO_COMPANY = 5;
case QUOTE_TO_DEAL = 64;
case QUOTE_TO_QUOTE_TEMPLATE = 286;
case QUOTE_TO_LINE_ITEM = 67;
@zzgael
zzgael / StackedError.js
Last active October 9, 2016 23:50
AdWords Script error log with stacktrace for your distant eval'd scripts.
/**
Depends on StackFrame and ErrorStackParser ( https://github.com/stacktracejs/stacktrace.js )
This custom Error function will bring a nice stacktrace to your logs.
It can also notify by email when not in preview mode ( optional )
As this works with eval'd scripts, you can just package
the dependencies plus your script and use this generic piece in every script:
-- USAGE IN YOUR SCRIPT --
@zzgael
zzgael / MatchableTrait.php
Last active July 30, 2020 03:54
Laravel 4+ very basic search Trait that you can add on any model
<?php
use Illuminate\Database\Query\Builder;
/**
* Trait MatchableTrait
* Author : Gael Debost
* Add a very basic match method to an Eloquent Model. Based on a SQL MATCH
* You need FULL TEXT Indexes in order to match fields. Somes rules :