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 / PHP Test Setup Method.sublime-snippet
Last active November 16, 2022 09:20
PHP Test Setup Method Sublime Snippet
<snippet>
<content>
protected function setUp() : void
{
parent::setUp();
${1}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
@ambengers
ambengers / Haiku.php
Last active November 16, 2022 09:14
Laravel Haiku Class
<?php
namespace App;
class Haiku
{
/**
* An array of adjectives.
*
@ambengers
ambengers / SearchesEloquent.php
Last active November 16, 2022 09:24
A trait for performing search on Eloquent model columns and related tables.
<?php
namespace App\Filters\Concerns;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\MorphTo;
trait SearchesEloquent
{
protected $query;
<snippet>
<content>
/** @test */
public function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>test</tabTrigger>
<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>
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>
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 -->
[
{
"args":
{
"characters": "/**"
},
"command": "insert"
},
{
"args": null,
[
{ "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" },
]
@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":