Skip to content

Instantly share code, notes, and snippets.

@mooror
Last active February 5, 2020 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mooror/8e2b1838ab9ab69816997a3796fbaa28 to your computer and use it in GitHub Desktop.
Save mooror/8e2b1838ab9ab69816997a3796fbaa28 to your computer and use it in GitHub Desktop.
VSCode Settings (Updated via Setting Sync)
{"lastUpload":"2020-02-05T18:43:15.841Z","extensionVersion":"v3.4.3"}
[
{
"metadata": {
"id": "fa57ae0e-d21e-40d8-a0bb-a58b5fd9ead3",
"publisherId": "ms-vscode.atom-keybindings",
"publisherDisplayName": "ms-vscode"
},
"name": "atom-keybindings",
"publisher": "ms-vscode",
"version": "3.0.6"
},
{
"metadata": {
"id": "0a536459-8968-4c18-a052-cc505a9ea555",
"publisherId": "huntertran.auto-markdown-toc",
"publisherDisplayName": "huntertran"
},
"name": "auto-markdown-toc",
"publisher": "huntertran",
"version": "3.0.3"
},
{
"metadata": {
"id": "e337c67b-55c2-4fef-8949-eb260e7fb7fd",
"publisherId": "Shan.code-settings-sync",
"publisherDisplayName": "Shan"
},
"name": "code-settings-sync",
"publisher": "Shan",
"version": "3.4.3"
},
{
"metadata": {
"id": "c5e725b7-bc00-4649-8bb8-901127e59f49",
"publisherId": "Altrue.CustomColoring",
"publisherDisplayName": "Altrue"
},
"name": "CustomColoring",
"publisher": "Altrue",
"version": "1.4.4"
},
{
"metadata": {
"id": "dd7e0ff7-9eb5-45fe-8b21-00e79b632b7f",
"publisherId": "dunstontc.dark-plus-syntax",
"publisherDisplayName": "dunstontc"
},
"name": "dark-plus-syntax",
"publisher": "dunstontc",
"version": "0.0.159"
},
{
"metadata": {
"id": "90a838c3-675b-4b87-b7a5-75ea88432cce",
"publisherId": "joelday.docthis",
"publisherDisplayName": "joelday"
},
"name": "docthis",
"publisher": "joelday",
"version": "0.7.1"
},
{
"metadata": {
"id": "5db78037-f674-459f-a236-db622c427c5b",
"publisherId": "PKief.material-icon-theme",
"publisherDisplayName": "PKief"
},
"name": "material-icon-theme",
"publisher": "PKief",
"version": "3.9.2"
},
{
"metadata": {
"id": "da62dfba-5132-4928-a127-0ef0c8af08c3",
"publisherId": "taniarascia.new-moon-vscode",
"publisherDisplayName": "taniarascia"
},
"name": "new-moon-vscode",
"publisher": "taniarascia",
"version": "1.8.8"
},
{
"metadata": {
"id": "ca0094fa-0dc7-4847-ae5d-879442c099ca",
"publisherId": "neilbrayfield.php-docblocker",
"publisherDisplayName": "neilbrayfield"
},
"name": "php-docblocker",
"publisher": "neilbrayfield",
"version": "2.1.0"
},
{
"metadata": {
"id": "d141a077-0142-407f-b1c9-7a12839b150d",
"publisherId": "adrianhumphreys.silverstripe",
"publisherDisplayName": "adrianhumphreys"
},
"name": "silverstripe",
"publisher": "adrianhumphreys",
"version": "0.0.5"
},
{
"metadata": {
"id": "b5eaebe8-c8c7-495a-80c5-3ba4a7a91c35",
"publisherId": "andischerer.theme-atom-one-dark",
"publisherDisplayName": "andischerer"
},
"name": "theme-atom-one-dark",
"publisher": "andischerer",
"version": "0.0.1"
},
{
"metadata": {
"id": "03944bdc-9bcb-4ac2-b9b3-fdb050dd43e4",
"publisherId": "mrmlnc.vscode-duplicate",
"publisherDisplayName": "mrmlnc"
},
"name": "vscode-duplicate",
"publisher": "mrmlnc",
"version": "1.2.1"
},
{
"metadata": {
"id": "9b2c953d-6ad4-46d1-b18e-7e5992d1d8a6",
"publisherId": "akamud.vscode-theme-onedark",
"publisherDisplayName": "akamud"
},
"name": "vscode-theme-onedark",
"publisher": "akamud",
"version": "2.1.0"
}
]
{
"telemetry.enableTelemetry": false,
"gitlens.currentLine.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"gitlens.codeLens.enabled": false,
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Atom One Dark",
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"editor.fontSize": 16,
"terminal.integrated.rendererType": "dom",
"emmet.excludeLanguages": [
"markdown",
"php"
],
"todo-tree.highlights.enabled": false,
"markdown-toc.anchorMode": "gitlab.com",
"markdown-toc.insertAnchor": true,
"markdown-toc.updateOnSave": false,
"files.trimTrailingWhitespace": true,
"cSpell.userWords": [
"varchar"
],
"editor.minimap.enabled": false,
"diffEditor.ignoreTrimWhitespace": false,
"sync.gist": "8e2b1838ab9ab69816997a3796fbaa28"
}
{
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Debug variable console": {
"prefix": "debug",
"body": [
"console.log('$1 -> '+$2);$3"
],
"description": "Print a variable to the console"
},
"Debug object console": {
"prefix": "debugobject",
"body": [
"console.log('$1 -> ');",
"console.dir($2);$3"
],
"description": "Print a object to the console"
}
}
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
// Silverstripe Bootstraps
"SS Bootstrap Page Class": {
"prefix": [
"page",
"boot-page"
],
"body": [
"use SilverStripe\\CMS\\Model\\SiteTree;",
"/**",
" * ${3:Description}",
" *",
" * @category Page",
" * @package ${4:Silverstripe}",
" ${5:* @subpackage ${6:module-name}}",
" */",
"class $1 extends ${2:Page}",
"{",
"\t${0}",
"}"
],
"description": "Bootstrap a Page class"
},
"SS Bootstrap Page Controller Class": {
"prefix": [
"pagecontroller",
"boot-page-controller"
],
"body": [
"use SilverStripe\\CMS\\Controllers\\ContentController;",
"/**",
" * ${3:Description}",
" *",
" * @category Page",
" * @package ${4:Silverstripe}",
" ${5:* @subpackage ${6:module-name}}",
" */",
"class ${1}Controller extends ${2:Page}Controller",
"{",
"\tpublic function doInit()",
"\t{",
"\t\tparent::doInit();",
"\t}${0}",
"}"
],
"description": "Bootstrap a Page controller class"
},
"SS Bootstrap DataObject Class": {
"prefix": [
"dataobject",
"boot-data-object"
],
"body": [
"use SilverStripe\\\\ORM\\\\DataObject;",
"",
"/**",
" * ${3:Description}",
" *",
" * @category Model",
" * @package ${4:Silverstripe}",
" ${5:* @subpackage ${6:module-name}}",
" */",
"class ${1} extends ${2:DataObject}",
"{",
"\t${0}",
"}"
],
"description": "Bootstrap a DataObject class"
},
"SS Bootstrap Model Admin Class": {
"prefix": [
"modeladmin",
"boot-model-admin"
],
"body": [
"use SilverStripe\\\\Admin\\\\ModelAdmin;",
"",
"/**",
"* ${5:Description}",
"*",
"* @category Model",
"* @package ${6:Silverstripe}",
"${7:* @subpackage ${8:module-name}}",
"*/",
"class ${1}Admin extends ModelAdmin",
"{",
"\t/**",
"\t * Managed data objects for CMS",
"\t * @var array",
"\t */",
"\tprivate static \\$managed_models = [",
"\t\t${2}",
"\t];",
"",
"\t/**",
"\t * URL Path for CMS",
"\t * @var string",
"\t */",
"\tprivate static \\$url_segment = '${3}';",
"",
"\t/**",
"\t * Menu title for Left and Main CMS",
"\t * @var string",
"\t */",
"\tprivate static \\$menu_title = '${4}';",
"",
"\t${0}",
"}"
],
"description": "Bootstrap a ModelAdmin class"
},
// Silverstripe properties
"SS menu_title": {
"prefix": "menu_title",
"body": [
"/**",
"* Menu title for Left and Main CMS",
"* @var string",
"*/",
"private static \\$menu_title = '${1}';${0}"
],
"description": "Silverstripe $menu_title property"
},
"SS menu_icon": {
"prefix": "menu_icon",
"body": [
"/**",
"* Menu icon for Left and Main CMS",
"* @var string",
"*/",
"private static \\$menu_icon = '${1}';${0}"
],
"description": "Silverstripe $menu_icon property"
},
"SS singular_name": {
"prefix": "singular_name",
"body": [
"/**",
"* Singular name for CMS",
"* @var string",
"*/",
"private static \\$singular_name = '${1}';${0}"
],
"description": "Silverstripe $singular_name property"
},
"SS table_name": {
"prefix": "table_name",
"body": [
"/**",
"* Defines the database table name",
"* @var string",
"*/",
"private static \\$table_name = '${1}';${0}"
],
"description": "Silverstripe $table_name property"
},
"SS db": {
"prefix": "db",
"body": [
"/**",
"* Database fields",
"* @var array",
"*/",
"private static \\$db = [",
"\t'${1}' => '${2}',",
"];${0}"
],
"description": "Silverstripe $db property"
},
"SS has_one": {
"prefix": "has_one",
"body": [
"/**",
"* Has_one relationship",
"* @var array",
"*/",
"private static \\$has_one = [",
"\t'${1}' => ${2},",
"];${0}"
],
"description": "Silverstripe $has_one relationship property"
},
"SS has_many": {
"prefix": "has_many",
"body": [
"/**",
"* Has_many relationship",
"* @var array",
"*/",
"private static \\$has_many = [",
"\t'${1}' => ${2},",
"];${0}"
],
"description": "Silverstripe $has_many relationship property"
},
"SS many_many": {
"prefix": "many_many",
"body": [
"/**",
"* Many_many relationship",
"* @var array",
"*/",
"private static \\$many_many = [",
"\t'${1}' => ${2},",
"];${0}"
],
"description": "Silverstripe $many_many relationship property"
},
"SS many_many_extraFields": {
"prefix": "many_many_extraFields",
"body": [
"/**",
"* Defines Database fields for the Many_many bridging table",
"* @var array",
"*/",
"private static \\$many_many_extraFields = [",
"\t'${1}' => [",
"\t\t'${2:Sort}' => '${3:Int}'",
"\t]",
"];${0}"
],
"description": "Silverstripe $many_many_extraFields relationship property"
},
"SS belongs_to": {
"prefix": "belongs_to",
"body": [
"/**",
"* Belongs_to relationship",
"* @var array",
"*/",
"private static \\$belongs_to = [",
"\t'${1}' => '${2}',",
"];",
"${0}"
],
"description": "Silverstripe $belongs_to relationship property"
},
"SS belongs_many_many": {
"prefix": "belongs_many_many",
"body": [
"/**",
"* Belongs_many_many relationship",
"* @var array",
"*/",
"private static \\$belongs_many_many = [",
"\t'${1}' => ${2},",
"];${0}"
],
"description": "Silverstripe $belongs_many_many relationship property"
},
"SS owns": {
"prefix": "owns",
"body": [
"/**",
"* Relationship version ownership",
"* @var array",
"*/",
"private static \\$owns = [",
"\t'${1}'",
"];"
],
"description": "Silverstripe $owns property"
},
"SS casting": {
"prefix": "casting",
"body": [
"/**",
"* Ensures that the methods are wrapped in the correct type and",
"* values are safely escaped while rendering in the template.",
"* @var array",
"*/",
"private static \\\\$casting = [",
"\\t'${1}' => '${2}'",
"];"
],
"description": "Silverstripe $casting property"
},
"SS defaults": {
"prefix": "defaults",
"body": [
"/**",
"* Add default values to database",
"* @var array",
"*/",
"private static \\$defaults = [",
"\t'${1}' => '${2}'",
"];"
],
"description": "Silverstripe $defaults property"
},
"SS allowed_actions": {
"prefix": "allowed_actions",
"body": [
"/**",
"* Defines methods that can be called directly",
"* @var array",
"*/",
"private static \\$allowed_actions = [",
"\t'${1}' => ${2:true}",
"];"
],
"description": "Silverstripe $allowed_actions property"
},
"SS summary_fields": {
"prefix": "summary_fields",
"body": [
"/**",
"* Defines summary fields commonly used in table columns",
"* as a quick overview of the data for this dataobject",
"* @var array",
"*/",
"private static \\$summary_fields = [",
"\t'${1}' => '${2}'",
"];"
],
"description": "Silverstripe $summary_fields property"
},
"SS searchable_fields": {
"prefix": "searchable_fields",
"body": [
"/**",
"* Defines a default list of filters for the search context",
"* @var array",
"*/",
"private static \\$searchable_fields = [",
"\t'${1}' => '${2}'",
"];"
],
"description": "Silverstripe $searchable_fields property"
},
// Silverstripe functions
"SS main translator function": {
"prefix": [
"_t",
"lexicon",
"translate"
],
"body": [
"_t(__CLASS__ . '.${1/([a-zA-Z]*)([^a-zA-Z]*)/\\U$1/}', '${2:${1}}')${0}"
],
"description": "Silverstripe translator function (_t)"
},
// Silverstripe methods
"SS onAfterWrite": {
"prefix": "onAfterWrite",
"body": [
"/**",
"* Event handler called after writing to the database.",
"*/",
"public function onAfterWrite()",
"{",
"\tparent::onAfterWrite();",
"\t${0}",
"}"
],
"description": "Silverstripe onAfterWrite() method"
},
"SS getCMSFields": {
"prefix": "getCMSFields",
"body": [
"/**",
"* CMS Fields",
"* @return FieldList",
"*/",
"public function getCMSFields()",
"{",
"\t\\$fields = parent::getCMSFields();",
"\t\\$fields->${0}",
"\treturn \\$fields;",
"}"
],
"description": "Silverstripe getCMSFields() method"
},
"SS getCMSFieldsScafoldless": {
"prefix": "getCMSFieldsScafoldless",
"body": [
"/**",
"* CMS Fields",
"* @return FieldList",
"*/",
"public function getCMSFields()",
"{",
"\t\\$fields = FieldList::create();",
"\t\\$fields->push(",
"\t\tTabSet::create(",
"\t\t\t'Root',",
"\t\t\tTab::create('Main')",
"\t\t)",
"\t);",
"\t\\$fields->${0}",
"\t\\$this->extend('updateCMSFields', \\$fields);",
"\treturn \\$fields;",
"}"
],
"description": "Silverstripe getCMSFields() method without parent scaffolding"
},
"SS updateCMSFields": {
"prefix": "updateCMSFields",
"body": [
"/**",
"* Update Fields",
"* @return FieldList",
"*/",
"public function updateCMSFields(FieldList \\$fields)",
"{",
"\t\\$owner = $this->owner;",
"\t\\$fields->${0}",
"\treturn \\$fields;",
"}"
],
"description": "Silverstripe updateCMSFields() method"
},
"SS getEditForm": {
"prefix": "getEditForm",
"body": [
"/**",
"* @param Int $id",
"* @param FieldList $fields",
"* @return Form",
"*/",
"public function getEditForm($id = null, $fields = null)",
"{",
"\t\\$form = parent::getEditForm($id, $fields);",
"\t${0}",
"\treturn \\$form;",
"}"
],
"description": "Silverstripe getEditForm() method"
},
// Silverstripe Member
"SS Current Member": {
"prefix": [
"member",
"current-member"
],
"body": [
"Member::currentUser()"
],
"description": "Get the current member"
},
"SS Current Member ID": {
"prefix": [
"memberid",
"current-memberid"
],
"body": [
"Member::currentUserID()"
],
"description": "Get the current member ID"
},
// Silverstripe configuration
"SS Current SiteConfig": {
"prefix": [
"siteconfig",
"site-config"
],
"body": [
"SiteConfig::current_site_config()"
],
"description": "Get the SiteConfig object"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment