Skip to content

Instantly share code, notes, and snippets.

@nnsdev
Last active July 10, 2017 16:40
Show Gist options
  • Save nnsdev/e94bab7e0ff652e6505b2a8c18143c29 to your computer and use it in GitHub Desktop.
Save nnsdev/e94bab7e0ff652e6505b2a8c18143c29 to your computer and use it in GitHub Desktop.
my sublime snippets (Thanks to @adamwathan for a lot of those)
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsTo(${1/^(.+)$/(?1\u$1:)/g}::class);
}
]]></content>
<tabTrigger>belo</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
}
]]></content>
<tabTrigger>belt</tabTrigger>
</snippet>
[
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["f6"], "command": "expand_fqcn" },
{ "keys": ["shift+f6"], "command": "expand_fqcn", "args": {"leading_separator": true} },
{ "keys": ["f5"], "command": "find_use" },
{ "keys": ["f4"], "command": "import_namespace" },
{ "keys": ["shift+f12"], "command": "goto_definition_scope" }
]
<snippet>
<content><![CDATA[
\$${1:user} = factory(${2:User}::class)->${3}create([${4}]);
]]></content>
<tabTrigger>fac</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
\$table->integer('${1:table}_id')->unsigned();
\$table->foreign('${1:table}_id')->references('id')->on('${1:table}');
]]></content>
<tabTrigger>fore</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
public function ${1}(${2})
{
${3}
}
]]></content>
<tabTrigger>fu</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsTo(${1/^(.+)$/(?1\u$1:)/g}::class);
}
]]></content>
<tabTrigger>hasM</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->hasOne(${1/^(.+)$/(?1\u$1:)/g}::class);
}
]]></content>
<tabTrigger>haso</tabTrigger>
</snippet>

A File Icon AdvancedNewFile AllAutocomplete Babel BracketHighlighter Color Highlighter ColorSublime Emmet Git GitGutter Gulp Laravel 5 Artisan Laravel Blade Highlighter LESS Material Theme Material Theme - White Panels Package Control PHP Companion phpfmt PyV8 Sass SideBarEnhancements SimplePHPUnit SublimeLinter SublimeLinter-jshint TrailingSpaces TypeScript Vuejs Complete Package WakaTime zzz A File Icon zzz

{
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"font_face": "Poppins",
"font_size": 11,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 0.5,
"line_padding_top": 0.5,
"phpunit.php_versions_path": "D:\\laragon\\bin\\php\\php-7.1.1-Win32-VC14-x86\\php.exe",
"theme": "Material-Theme.sublime-theme",
"translate_tabs_to_spaces": true
}
<snippet>
<content><![CDATA[
\$response = \$this->actingAs(\$${1:user})->${2:get}(${3})
]]></content>
<tabTrigger>ra</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
/** @test */
function ${1:the_one_where}()
{
${0}
}
]]></content>
<tabTrigger>test</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
<?php
use Tests\TestCase;
class ${TM_FILENAME/(\w+)\.php/\1/} extends TestCase
{
${0}
}
]]></content>
<tabTrigger>testcase</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
\$this->
]]></content>
<tabTrigger>$</tabTrigger>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment