Skip to content

Instantly share code, notes, and snippets.

View ajcastro's full-sized avatar

Arjon Jason Castro ajcastro

View GitHub Profile
@ajcastro
ajcastro / sublime_phpcs_installation.md
Last active July 17, 2019 03:21
Sublime Phpcs plugin Installation Instructions (LATEST)
@ajcastro
ajcastro / phpcs-user-settings
Last active March 3, 2019 03:39
My Phpcs User Settings
{
"phpcs_additional_args": {
"--standard": "PSR2",
"--exclude": "Generic.Files.LineEndings",
"-n": ""
},
// PHP_CodeSniffer settings
"phpcs_command_on_save": false,
"phpcs_executable_path": "/usr/bin/phpcs",
@ajcastro
ajcastro / namespaced_class_declaration.sublime-snippet
Last active February 7, 2019 02:04
Php class declaration sublime snippet
<snippet>
<content><![CDATA[
<?php
namespace ${1:${TM_FILEPATH/(?:.*app\/)|(\/)?([^\/]+)(?=\/)|(?:\/[^\/]+\.php$)/(?1:\\$^N:$^N)/g}};
class ${2:${TM_FILENAME/(.*)[.](.*)/$1/g}} ${3:extends}
{
${4:public} function ${5:methodName}($6)
{
@ajcastro
ajcastro / db_foreign_key.sublime-snippet
Created July 2, 2015 05:46
Laravel schema foreign key declaration snippet
<snippet>
<content><![CDATA[
\$table->foreign('${1:column}')->references('${2:id}')->on('${3:table}')->onDelete('${4:restrict}')->onUpdate('${5:cascade}');
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>foreign</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
@ajcastro
ajcastro / theme-flatland-settings.json
Last active February 7, 2019 02:17
Theme Flatland sublime settings
{
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"flatland_sidebar_tree_small": true,
"flatland_square_tabs": true,
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
"theme": "Flatland Dark.sublime-theme",
@ajcastro
ajcastro / theme-seti-settings.json
Created July 2, 2015 05:48
Theme Seti_UI sublime settings
{
"Seti_SB_bright": true,
"Seti_SB_med": true,
"Seti_sb_small_padding": true,
"Seti_sb_tree_med": true,
"Seti_tabs_small": true,
"color_scheme": "Packages/Seti_UI/Scheme/Seti_monokai.tmTheme",
"font_size": 10,
"ignored_packages":
[
@ajcastro
ajcastro / laravel-eloquent-polymorphic-table-relations.md
Last active August 29, 2015 14:24
Laravel Eloquent Custom Polymorphic Table Relations

Laravel Eloquent Polymorphic Table Relations

Consider this tables: products and product_settings.

Table products

id name
1 Laptop
2 Tablet
@ajcastro
ajcastro / TodoReview.sublime-settings
Created August 25, 2015 06:16
TodoReview user-settings
{
"patterns": {
"TODO": "TODO[\\s]*?:[\\s]*(?P<todo>.*)$",
"NOTE": "NOTE[\\s]*?:[\\s]*(?P<note>.*)$",
"FIXME": "FIX ?ME[\\s]*?:[\\s]*(?P<fixme>.*)$",
"CHANGED": "CHANGED[\\s]*?:[\\s]*(?P<changed>.*)$"
},
"exclude_folders": [
"*.git*",
"vendor"
[
"Alignment",
"AlignTab",
"All Autocomplete",
"AngularJS",
"Auto Semi-Colon",
"Case Conversion",
"CodeFormatter",
"DocBlockr",
"Emmet",