Skip to content

Instantly share code, notes, and snippets.

View srosato's full-sized avatar

Steven Rosato srosato

View GitHub Profile
@srosato
srosato / nodejs14-monorepo-local-compile-trace-json.txt
Last active February 6, 2024 21:30
Slow local dev compile traec of NextJS app as an Nx monorepo using lots of barrel files
This file has been truncated, but you can view the full file.
@srosato
srosato / Code.gs
Last active August 15, 2023 19:36
Forward Gmail emails to Quickbooks using a Google Script.
// create a script on https://script.google.com/
function processReceipts() {
const userEmail = Session.getActiveUser().getEmail().toLowerCase();
const newReceiptsLabel = GmailApp.getUserLabelByName('receipts-unprocessed');
const processedReceiptsLabel = GmailApp.getUserLabelByName('receipts-processed');
const destinationEmail = "[email protected]"
console.log(`Running as ${userEmail}`);
@srosato
srosato / AbstractValidationTest.php
Last active September 19, 2016 16:04
Form Validation Testing
<?php
namespace Tests\Component\Validation;
use Mockery as m;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Tests\Codeception\TestCase\ComponentTest;
<?php
namespace Tests\Ez\Functional\Data;
use Tests\Codeception\TestCase\FunctionalTest;
use Tests\Ez\Codeception\DataConfiguration;
use Tests\Ez\FunctionalTester;
/**
* System should be translatable through a Web Interface
@srosato
srosato / CreditCardTypeTest.php
Last active September 19, 2016 16:05
Form Type Testing
<?php
namespace Tests\Ez\Unit\ECommerce\Form;
use Ez\ECommerce\Form\CreditCardType;
use Majisti\ECommerce\CreditCard\CreditCard;
use Majisti\Testing\TestCase\FormTypeTest;
use Mockery as m;
use Symfony\Component\Validator\Constraints\NotBlank;
@srosato
srosato / ReservationCest.php
Created March 2, 2016 18:58
API Testing Example
<?php
namespace Tests\Ez\Functional\Api;
use Codeception\Scenario;
use FOS\RestBundle\Util\Codes;
use Tests\Ez\FunctionalTester;
/**
* @group api
@srosato
srosato / CommandHelper.php
Last active March 2, 2016 18:32
Symfony Command Line Testing
<?php
namespace Tests\Ez\Helper;
use Codeception\Module;
use Codeception\TestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application as ConsoleApplication;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\StreamOutput;
<?php
// Nous vérifions que l'utilisateur est bien du bon type pour ne pas appeler getLastActivity() sur un objet autre objet User
if ($user instanceof User && $user->getLastActivity() < $delay) {
$user->setActiveNow();
$this->em->flush($user);
}
if ($user instanceof User && $user->getLastActivity() < $delay) {
$user->setActiveNow();