Skip to content

Instantly share code, notes, and snippets.

@TechNinjaWeb
Last active July 14, 2017 00:49
Show Gist options
  • Save TechNinjaWeb/2704dd7d308fbc530f278aaab3b00da3 to your computer and use it in GitHub Desktop.
Save TechNinjaWeb/2704dd7d308fbc530f278aaab3b00da3 to your computer and use it in GitHub Desktop.
Sublime Snippets
<!-- Chrome Browser App Manifest json generator -->
<snippet>
<content><![CDATA[
{
"name": "TechNijaApp",
"version": "1.0",
"description": "Does every and anything you want it to!",
"icons": {
"16": "techninja_icon_16.png",
"48": "techninja_icon_48.png",
"120": "techninja_icon_120.png"
},
"background": {
"scripts": [""]
},
"browser_actions": {
"default_title": "TechNijaApp",
"default_icon": "techninja_icon_16.png"
},
"options_page": "options.html",
"permissions": [
"background",
"tabs",
"http://*/*",
"https://*/*"
],
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>chrome-manifest</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.json</scope>
</snippet>
<!-- C++ Document Comment Block -->
<snippet>
<content><![CDATA[
/******************************************************************************
*
* @filename: ${1:file_name}.cpp
* @author: ${2:Tech Ninja}
* @since: ${3:2017.03.06}
* @date: ${4:January 15, 2017}
* @description: ${5:Archers will compete in 4 rounds/ends. Each end will be
* tracked and scored out of 60. The program will display each
* archer's average end score and the overall match average.}
*
* @credits: $6
*
*****************************************************************************/
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cpp-comment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.c++</scope>
</snippet>
<!-- C++ Function body and comment block -->
<snippet>
<content><![CDATA[
/** ${1:someFunction}() ${2:describe this function}
* @param ${3:string}: ${4:describe this paramenter type}
* @return ${5:int}: ${6:describe the function's return value}
*/
${7:int} ${8:someFunction}(${9:string} ${10:argument})
{
// ${11:DEBUGGIN}
cout << {12:"Function is working" << std::endl
<< "Argument: " << argument << std::endl << std::endl;}
// ${13:Optional return value
int returnValue = 0;
return returnValue;}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cpp-function</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.c++</scope>
</snippet>
<!-- CSS Section Comment Block -->
<snippet>
<content><![CDATA[
/* --------------------------------------
* ${0:Comment Block}
* -------------------------------------- */
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>comment/</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.css</scope>
</snippet>
<!-- CSS Document Comment Block -->
<snippet>
<content><![CDATA[
/**********************************************************************************
* Name: ${1:Tech Ninja}
* Date: ${2:February 8, 2017}
* Description: ${3:Some cool description}
***********************************************************************************/
/* ------------------------
${4:COLOR PROFILES}
------------------------
${5:Primary Color: #7F2C02;
Secondary Color: #F4A209;
Highlight Color: #FDEF68;
Darken Color: #A24305;
Accent Color: #FFD847;}
------------------------
*/
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>css-comment/</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.css</scope>
</snippet>
<!-- HTML Document Comment block -->
<snippet>
<content><![CDATA[
<!--
Name: ${0:Tech Ninja}
File: ${1:lab1}.${2:html}
Date: ${3:November 27, 2016}
Description: ${4:Lab 1
Class: Web Development - Fundamentals (WEBD2201)
URL: http://opentech2.durhamcollege.org/pufferd/webd2201
Institute: Durham College
Homepage: http://www.durhamcollege.ca/}
Credits: ${5}
-->
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>html-comment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html</scope>
</snippet>
<!-- HTML Table Generator -->
<snippet>
<content><![CDATA[
<table border='0'>
<thead>
<tr>
<th>${1:Title One}</th>
</tr>
</thead>
<tbody>
<tr>
<td>${2:Some Body}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>${4:Footer Area}</td>
</tr>
</tfoot>
</table>
]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>html-table</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>text.html</scope>
<!-- Optional: Description to show in the menu -->
<description>Table with 3 sections Head, Body, Row for Footer</description>
</snippet>
<!-- Typescript and JS Document Comment Block -->
<snippet>
<content><![CDATA[
/**********************************************************************
* Filename: ${1:dev-brand.component.ts}
* Author: ${2:Tech Ninja}
* Date: ${3:May 26, 2017}
* Description: ${4:Angular component that controls the dev-tag branding
* below the page footer. }
* Credits: $6
**********************************************************************/
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>comment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js, source.ts</scope>
</snippet>
<!-- Javascript success callback object -->
<snippet>
<content><![CDATA[
{
success: function(res)
{
${1:console.info(["Response", arguments])}
},
error: function(err)
{
${2:console.info(["Error", arguments])}
}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>success</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
<snippet>
<content><![CDATA[
@${1:Decorator}()
export class ${2:ClassName} {
constructor ($3)
{
${5:console.log("Loaded Clases", this)}
}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ng-class</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.ts</scope>
</snippet>
<!-- PHP Document Comment Block -->
<snippet>
<content><![CDATA[
<?php
/**********************************************************************************
* Name: ${1:Tech Ninja}
* Date: ${2:February 8, 2017}
* Description: ${3:Some cool description}
***********************************************************************************/
// Variable Declarations
$title = "${4:Page Title}";
$date = "${5:March 24, 2017}";
$filename = "${6:document}.${7:title}";
$description = "${Some description for this document}";
$eol = "\n";
?>
<!--
Name: ${8:Tech Ninja}
File: <?php echo $filename . $eol; ?>
Date: <?php echo $date . $eol; ?>
Description: <?php echo $description . $eol; ?>
Credits: $9
-->
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>php-comment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
<!-- SQL Document Comment Block -->
<snippet>
<content><![CDATA[
--Author: ${1:Tech Ninja}
--Filename: ${2:file_name}.sql
--Date: ${3:22 March 2017}
--Description: $4
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>sql-comment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.sql</scope>
</snippet>
<!-- Standard slash asterisk based comment -->
<snippet>
<content><![CDATA[
/**********************************************************************
* ${1:Comment}: ${2:Description}
**********************************************************************/
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>comment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js, source.ts, source.php, source.c++</scope>
</snippet>
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
CSS: source.css
D: source.d
Diff: source.diff
Erlang: source.erlang
Go: source.go
GraphViz: source.dot
Groovy: source.groovy
Haskell: source.haskell
HTML: text.html(.basic)
JSP: text.html.jsp
Java: source.java
Java Properties: source.java-props
Java Doc: text.html.javadoc
JSON: source.json
Javascript: source.js
Typescript: source.ts
BibTex: source.bibtex
Latex Log: text.log.latex
Latex Memoir: text.tex.latex.memoir
Latex: text.tex.latex
LESS: source.css.less
TeX: text.tex
Lisp: source.lisp
Lua: source.lua
MakeFile: source.makefile
Markdown: text.html.markdown
Multi Markdown: text.html.markdown.multimarkdown
Matlab: source.matlab
Objective-C: source.objc
Objective-C++: source.objc++
OCaml campl4: source.camlp4.ocaml
OCaml: source.ocaml
OCamllex: source.ocamllex
Perl: source.perl
PHP: source.php
Regular Expression(python): source.regexp.python
Python: source.python
R Console: source.r-console
R: source.r
Ruby on Rails: source.ruby.rails
Ruby HAML: text.haml
SQL(Ruby): source.sql.ruby
Regular Expression: source.regexp
RestructuredText: text.restructuredtext
Ruby: source.ruby
SASS: source.sass
Scala: source.scala
Shell Script: source.shell
SQL: source.sql
Stylus: source.stylus
TCL: source.tcl
HTML(TCL): text.html.tcl
Plain text: text.plain
Textile: text.html.textile
XML: text.xml
XSL: text.xml.xsl
YAML: source.yaml
<!-- Visual Basic Document Comment Block -->
<snippet>
<content><![CDATA[
'#######################################################################################################
'Author: ${0:Tech Ninja}
'Date: ${1:January 23, 2017}
'Description: ${2:A Point of Sales system created for The Cantina Bar from Star Wars.
' It is designed to allow a user to select a type of drink,
' type of meal, and a set of snacks for purchase and will display totals
' for each category and a sum for all}
'
'Credits: ${3:https://msdn.microsoft.com/en-us/library/6y3efyhx(v=vs.100).aspx
' https://msdn.microsoft.com/en-us/library/3352e6f5(v=vs.90).aspx
' https://msdn.microsoft.com/en-us/library/3e54ke41(v=vs.100).aspx
' https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx
' http://stackoverflow.com/questions/10559588/check-which-checkbox-is-checked-with-loop}
'#######################################################################################################
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>vb-comment</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.vb</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment