Skip to content

Instantly share code, notes, and snippets.

View nick322's full-sized avatar

Nick Huang nick322

View GitHub Profile
@nick322
nick322 / ForwardsCalls.php
Last active June 17, 2022 06:15
ForwardsCalls_example.php
<?php
namespace App\Exports;
use Rap2hpoutre\FastExcel\FastExcel;
use Illuminate\Support\LazyCollection;
use Illuminate\Support\Traits\ForwardsCalls;
/**
* @method $this download($path, callable $callback = null)
@nick322
nick322 / generate_cloudwatch_insights_url.php
Last active July 8, 2021 07:05
generate_cloudwatch_insights_url.php
<?php
function getInsightsUrl($region = 'ap-northeast-1') {
// https://stackoverflow.com/questions/67734825/why-is-laravels-carbon-toisostring-different-from-javascripts-toisostring
$start = now()->subMinutes(2)->format('Y-m-d\TH:i:s.v\Z');
$end = now()->addMinutes(2)->format('Y-m-d\TH:i:s.v\Z');
$filter = 'INFO';
$logStream = 'xxx_backend_web';
@nick322
nick322 / testing mail in droplet with laravel
Created March 30, 2020 10:32 — forked from emmanuelbarturen/testing mail in droplet with laravel
send email from artisan with tinker of laravel
# SSH into droplet
# go to project
$ php artisan tinker
$ Mail::raw('Text', function ($message){$message->to('contact@contact.com');});
# check your mailbox