Skip to content

Instantly share code, notes, and snippets.

View Chun-Yang's full-sized avatar

yang2007chun Chun-Yang

View GitHub Profile
<snippet>
<content><![CDATA[
\$.ajax({
url:'/ajax/${1:controller}/${2:action}',
data:{
${3}
},
dataType:'json',
type:'POST',
success:function (response) {
[
// -------------------------------------------------------------------------
// Auto-complete behaviour for ), ], '', ""
// Bind to <tab> to step over the auto-completed character(s)
// -------------------------------------------------------------------------
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true},
"context":
[
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)\\]'\"]", "match_all": true },
<snippet>
<content><![CDATA[
do
$1
end
]]></content>
<tabTrigger>do</tabTrigger>
<scope>source.ruby</scope>
<description>do..end</description>
</snippet>
@Chun-Yang
Chun-Yang / js_logv.sublime-snippet
Created May 29, 2014 16:12
js log with variable
<snippet>
<content><![CDATA[
console.log("${1}:");
console.log(${1});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>logv</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@Chun-Yang
Chun-Yang / php_debug.sublime-snippet
Created May 29, 2014 16:13
php show data in pre tags
<snippet>
<content><![CDATA[
print "<pre>";
print_r(${1:data});
print "</pre>";
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>debug</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
@Chun-Yang
Chun-Yang / js_log.sublime-snippet
Created May 29, 2014 16:13
js log without var
<snippet>
<content><![CDATA[
console.log("${1}");
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>log</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
<snippet>
<content><![CDATA[
public function ${1:name}() {
${2}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>public</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
@Chun-Yang
Chun-Yang / separator.sublime-snippet
Created May 29, 2014 16:14
all add hyphen as spearator
<snippet>
<content><![CDATA[
---------------
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>--</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<description>Add Hyphen As Separator</description>
</snippet>
<snippet>
<content><![CDATA[
System.out.println(${1:data});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>println</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.java</scope>
</snippet>
@Chun-Yang
Chun-Yang / rails_log.sublime-snippet
Created May 29, 2014 16:15
ruby rails add log for rails
<snippet>
<content><![CDATA[
Rails.logger.info "$0"
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>log</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.ruby.rails, source.ruby</scope>
<description>Add Log For Rails</description>
</snippet>