Skip to content

Instantly share code, notes, and snippets.

@dirgagautama
dirgagautama / CKEditor v4.7.1 Replace.sublime-snippet
Created July 14, 2017 11:03
CKEditor v4.7.1 - Replace Textarea with CKEditor's component
<snippet>
<content><![CDATA[
// Replace the <textarea id="editor1"> with a CKEditor instance, using default configuration.
CKEDITOR.replace( '${1:editor1}' );
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ckeditor_replace</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@dirgagautama
dirgagautama / CKEditor v4.7.1 Include File.sublime-snippet
Created July 14, 2017 11:02
CKEditor v4.7.1 - Include necessary CKEditor's files in script
<snippet>
<content><![CDATA[
<script src="${1:/js/ckeditor.js}"></script>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ckeditor_file</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html.basic</scope>
</snippet>
<snippet>
<content><![CDATA[
\$${1:qry} = "SELECT
FROM
WHERE ";
\$${2:rs} = \$myDatabase->query(\$${1}, MYSQLI_STORE_RESULT);
if ( \$${2} === false || \$${2}->num_rows == 0 ) {
${3}
} else {
\$${4:row} = \$${2}->fetch_object();
<snippet>
<content><![CDATA[
\$${1:qry} = "INSERT INTO
VALUES ";
\$${2:rs} = \$myDatabase->query(\$${1}, MYSQLI_STORE_RESULT);
if ( \$${2} === false ) {
${3}
} else {
${4}
}
<snippet>
<content><![CDATA[
<!DOCTYPE html>
<html lang="en">
<head>
<title>${1:Title Page}</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap -->
<snippet>
<content><![CDATA[
Sublime Text 3 - Useful Shortcuts for Windows
=============================================
*Tested in Windows 8:
Open/Goto
_________
- ctrl+p: go to file