This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Abilities; | |
use Illuminate\Support\Str; | |
use ReflectionClass; | |
/** | |
* Note: This is a preview of an upcoming package from Tighten. | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.sales.aggregate([ | |
{ | |
$lookup : { | |
from: "services", | |
localField: "_id", | |
foreignField: "saleId", | |
as:"servicesOfSale" | |
} | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.sales.aggregate([ | |
{ | |
$group : { | |
_id : {//Agruppated mandatory field (doesnt mean the ObjectId of document) | |
'year' : { '$year': "$createdAt"}, | |
'month' : { '$month': "$createdAt"}, | |
'day' : { '$dayOfMonth': "$createdAt"} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var docs = db.getCollection("sales").aggregate([ | |
{$match : {createdAt : {$gte : lastQuery}} } | |
{$unwind : '$createdAt'}, | |
{$unwind : '$updatedAt'}, | |
{$unwind : '$services'}, | |
{$group : { | |
_id : {'service' : '$services', 'user' : '$user', 'pointOfSale' : '$pointOfSale', 'createdAt' : '$createdAt', 'updatedAt' : '$updatedAt'}} | |
}, | |
{$project : { | |
service : "$_id.service", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var file = cat('path/to/yourFile.txt'); | |
var lastQuery = new Date(); | |
var docs = db.getCollection("sales").aggregate([ | |
{$match : {createdAt : {$gte : lastQuery}} } | |
{$unwind : '$createdAt'}, | |
{$unwind : '$updatedAt'}, | |
{$unwind : '$services'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ruleset name="teranex PMD ruleset" xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description>PMD ruleset</description> | |
<!-- ************************************************************************** --> | |
<!-- ============================= Clean Code Rules ========================== --> | |
<!-- =================== https://phpmd.org/rules/cleancode.html =============== --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
log_format main escape=json '{' | |
'"timestamp":"$time_local",' | |
'"remote_addr":"$remote_addr",' | |
'"request":"$request",' | |
'"request_method":"$request_method",' | |
'"request_uri":"$request_uri",' | |
'"status_code":"$status",' | |
'"http_user_agent":"$http_user_agent",' | |
'"http_x_forwarded_for":"$http_x_forwarded_for",' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'default' => env('LOG_CHANNEL', 'stack'), | |
'channels' => [ | |
'stack' => [ | |
'driver' => 'stack', | |
'channels' => ['single'], | |
], | |
'single' => [ |