Skip to content

Instantly share code, notes, and snippets.

View ambengers's full-sized avatar
🌙
A conscious speck of stardust.

Marvin Quezon ambengers

🌙
A conscious speck of stardust.
View GitHub Profile
@ambengers
ambengers / HasResponseMacros.php
Last active September 14, 2018 08:28
Test macro to better inspect response data.
<?php
namespace Tests;
use PHPUnit\Framework\Assert;
use Illuminate\Support\Collection;
use Illuminate\Foundation\Testing\TestResponse;
trait HasResponseMacros
{
@ambengers
ambengers / InteractsWithQueryFilters.php
Last active March 26, 2019 08:41
Trait for testing laravel-query-filter package
<?php
namespace Tests\Feature\Concerns;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Foundation\Testing\TestResponse;
trait InteractsWithQueryFilters
{
@ambengers
ambengers / .php-cs-fixer.dist.php
Last active November 14, 2022 02:12
Rules for PHP codestyle.
<?php
$rules = [
'@PSR2' => true,
// Syntax...
'array_syntax' => ['syntax' => 'short'],
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
'allow_single_line_closure' => true,
@ambengers
ambengers / Preferences.sublime-settings
Last active November 16, 2022 09:22
Sublime Text 3 User Preferences
{
"binary_file_patterns":
[
"node_modules",
".git"
],
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Inspired GitHub Color Scheme/InspiredGitHub.tmTheme",
"folder_exclude_patterns":
[
{ "keys": ["f3"], "command": "implement" },
{ "keys" : ["f4"], "command": "insert_php_constructor_property" },
{ "keys": ["super+'"], "command": "run_macro_file", "args": {"file": "res://Packages/User/PHP Docbloc.sublime-macro"} },
{ "keys": ["super+9"], "command": "find_use" },
{ "keys": ["super+0"], "command": "expand_fqcn" },
{ "keys": ["command+shift+r"], "command": "goto_symbol_in_project" },
{ "keys": ["super+e"], "command": "run_last_phpunit_test" },
{ "keys": ["super+shift+e"], "command": "run_phpunit_test" },
]
[
{
"args":
{
"characters": "/**"
},
"command": "insert"
},
{
"args": null,
<snippet>
<content>
protected function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pmet</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<snippet>
<content>
public function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>met</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<snippet>
<content>
public static function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>smet</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<snippet>
<content>
/** @test */
public function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>test</tabTrigger>