Skip to content

Instantly share code, notes, and snippets.

@biswajitpaul01
Last active March 7, 2020 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biswajitpaul01/f5a6e8efd98b6ebcc44d8a4cc6545043 to your computer and use it in GitHub Desktop.
Save biswajitpaul01/f5a6e8efd98b6ebcc44d8a4cc6545043 to your computer and use it in GitHub Desktop.
VSCode User Snippets
{
"wp.theme": {
"prefix": "wp.theme",
"body": [
"/*",
"Theme Name: $1",
"Theme URI: $2",
"Author: $3",
"Author URI: $4",
"Description: $5",
"Requires at least: WordPress 4.9.6",
"Version: $6",
"Text Domain: $7",
"*/"
],
"description": "Wordpress Theme Header"
},
"boilerplate": {
"prefix": "boilerplate",
"body": [
":active,:focus{outline:none;}",
"::-moz-focus-inner{border:0;}",
"input:focus,textarea:focus,button:focus{outline:none !important}",
"body{margin:0;padding:0}",
"img{height:auto;image-rendering:-webkit-optimize-contrast;max-width:100%}",
]
}
}
{
"scope": {
"prefix": "scope",
"body": [
"\"use strict\";",
"(function($){",
"",
"\t$1",
"",
"})(jQuery);"
],
"description": "Add script scope binding"
},
"ajax": {
"prefix": "ajax",
"body": [
"$.ajax({",
"\turl: $1,",
"\ttype: \"post\",",
"\tdata: $2,",
"\tdataType: \"json\",",
"\tbeforeSend: function () {",
"\t\t$3",
"\t},",
"\tcomplete: function () {",
"\t\t$4",
"\t},",
"\tsuccess: function(resp) {",
"\t\t$5",
"\t},",
"\terror: function(err) {",
"\t\tconsole.log(err);",
"\t}",
"});"
],
"description": "jQuery ajax shortcut"
}
}
{
"Debug Variable PHP": {
"prefix": "debug_var_php",
"body": [
"echo '<pre>'; print_r( $1 ); echo '</pre>';"
],
"description": "Debug Variable in PHP mode"
},
"Debug Variable HTML": {
"prefix": "debug_var_html",
"body": [
"<pre><?php print_r( $1 ); ?></pre>"
],
"description": "Debug Variable in HTML mode"
},
"wp.plugin.header": {
"prefix": "wp.plugin.header",
"body": [
"/*",
"Plugin Name: $1",
"Plugin URI: $2",
"Description: $3",
"Version: $4",
"Author: $5",
"Author URI: $6",
"Text Domain: $7",
"Domain Path: /languages",
"*/"
],
"description": "WordPress Plugin Header Block"
},
"wp.theme.header": {
"prefix": "wp.theme.header",
"body": [
"/*",
"Theme Name: $1",
"Theme URI: $2",
"Author: $3",
"Author URI: $4",
"Description: $5",
"Version: $6",
"Text Domain: $7",
"*/"
],
"description": "WordPress Theme Header Block"
},
"wp.template.header": {
"prefix": "wp.template.header",
"body": [
"/*",
"Template Name: $1",
"Description: $2",
"*/"
],
"description": "WordPress Theme Template Header Block"
},
"m2.registration": {
"prefix": "m2.registration",
"body": [
"use \\Magento\\Framework\\Component\\ComponentRegistrar;",
"",
"ComponentRegistrar::register(ComponentRegistrar::MODULE, '$1_$2', __DIR__);"
],
"description": "M2 registration.php for module/extension"
}
}
{
"m2.module.xml": {
"prefix": "m2.module.xml",
"body": [
"<?xml version=\"1.0\"?>",
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">",
"\t<module name=\"$1_$2\" setup_version=\"$3\">",
"\t\t<sequence>",
"\t\t\t<module name=\"Magento_Catalog\"/>",
"\t\t</sequence>",
"\t</module>",
"</config>"
],
"description": "M2 etc/module.xml"
},
"m2.routes.xml.frontend": {
"prefix": "m2.routes.xml.frontend",
"body": [
"<?xml version=\"1.0\"?>",
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:App/etc/routes.xsd\">",
"\t<router id=\"standard\">",
"\t\t<route id=\"$1\" frontName=\"$2\">",
"<module name=\"$3\" />",
"\t\t</route>",
"\t</router>",
"</config>"
],
"description": "M2 etc/routes.xml"
},
"m2.routes.xml.backend": {
"prefix": "m2.routes.xml.backend",
"body": [
"<?xml version=\"1.0\"?>",
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:App/etc/routes.xsd\">",
"\t<router id=\"admin\">",
"\t\t<route id=\"$1\" frontName=\"$2\">",
"<module name=\"$3\" />",
"\t\t</route>",
"\t</router>",
"</config>"
],
"description": "M2 etc/routes.xml"
},
"m2.layout.xml": {
"prefix": "m2.layout.xml",
"body": [
"<?xml version=\"1.0\"?>",
"<page xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" layout=\"1column\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View/Layout/etc/page_configuration.xsd\">",
"\t<body>",
"\t\t<referenceContainer name=\"content\">",
"\t\t\t$1",
"\t\t</referenceContainer>",
"\t</body>",
"</page>"
],
"description": "M2 layout.xml"
},
"m2.crontab.xml": {
"prefix": "m2.crontab.xml",
"body": [
"<?xml version=\"1.0\"?>",
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Cron:etc/crontab.xsd\">",
"\t<group id=\"$1\">",
"\t\t<job name=\"$2\" instance=\"$3\" method=\"$4\">",
"\t\t\t<schedule>$5</schedule>",
"\t\t</job>",
"\t</group>",
"</config>"
],
"description": "M2 etc/crontab.xml"
},
"m2.acl.xml": {
"prefix": "m2.acl.xml",
"body": [
"<?xml version=\"1.0\"?>",
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Acl/etc/acl.xsd\">",
"\t<acl>",
"\t\t<resources>",
"\t\t\t$1",
"\t\t</resources>",
"\t</acl>",
"</config>"
],
"description": "M2 etc/acl.xml"
},
"m2.menu.xml": {
"prefix": "m2.menu.xml",
"body": [
"<?xml version=\"1.0\"?>",
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Backend:etc/menu.xsd\">",
"\t<menu>",
"\t\t<add id=\"$1\" title=\"$2\" translate=\"$3\" module=\"$4\" sortOrder=\"$5\" parent=\"$6\" action=\"$7\" resource=\"$8\"/>",
"\t</menu>",
"</config>"
],
"description": "M2 etc/adminhtml/menu.xml"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment