Created
November 26, 2015 13:27
-
-
Save saevarom/633ad44832d9dfff5a82 to your computer and use it in GitHub Desktop.
Sublime snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[var $1 = (function() { | |
// $1 model | |
var self = null; | |
// ------------------------------------------------------------ | |
// constructor | |
function $1(initial_data){ | |
this.raw_data = initial_data; | |
this.json = null; | |
// needed for private methods | |
self = this; | |
} | |
// ------------------------------------------------------------ | |
// public methods | |
$1.prototype.get_json = function() { | |
return this.json; | |
} | |
// ------------------------------------------------------------ | |
// private methods | |
function parse_raw_data(){ | |
self.json = \$.parseJSON(self.raw_data); | |
} | |
// ------------------------------------------------------------ | |
// return constructor | |
return $1; | |
})();]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>jsmodel</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.python</scope> --> | |
</snippet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[_('${1:string}')]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>tran</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.ruby</scope> --> | |
</snippet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[<%= _('${1:string}') %>]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>trans</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.ruby</scope> --> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment