Skip to content

Instantly share code, notes, and snippets.

@idcmardelplata
Created September 20, 2015 19:49
Show Gist options
  • Save idcmardelplata/95cf74fd05a225ee326c to your computer and use it in GitHub Desktop.
Save idcmardelplata/95cf74fd05a225ee326c to your computer and use it in GitHub Desktop.
snippet doc "html5 doctype" !b
doctype html
html(lang="es")
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width")
title ${1:Titulo de la web.}
body
header
h1 $1
img(src="http://www.lorempixel.com/300/200" alt="Logo")
h2 ${2: Breve descripcion de la web}
section.content
footer
p ${3: Contenido del footer.}
endsnippet
snippet script "Insert script inline" !b
script(type="text/javascript")
${1://TODO: Complete the current script code.}
endsnippet
snippet scriptsrc "Script src snippet" !b
script(src="${1:filename}.js")
$2
endsnippet
snippet if "make a new if sentence" !b
if ${1:condition}
$2
endsnippet
snippet ife "make a new if else sentence" !b
if ${1:condition}
${2:Content here}
else
$3
endsnippet
snippet case "A shorthand of switch sentence in javascript" !b
case ${1:condition}
when ${2: option}
$3
endsnippet
snippet whe "when option of case sentence" !b
when ${1:option}
${2:content}
endsnippet
snippet defa "Default option of case sentence" !b
default
${1:Contenido por defecto}
endsnippet
snippet - "Code snippet" !b
- ${1:block of code}
endsnippet
snippet arr "Array declaration" !b
- ${1:list} = ["$2","$3","$4"]
endsnippet
#loops
snippet for "for loop for javascript" !b
- for (var ${1:x} = 0; $1; $1++})
${2:Contenido del bucle aqui.}
endsnippet
snippet wh "While loop" !b
while ${1:variable} ${2: condition }
${3://TODO: Content of loop here.}
endsnippet
snippet ea "each sentence" !b
each ${1:Item} in ${2:Items}
$3
endsnippet
#Filter sentences
snippet :mk "Markdown filter" !b
:markdown
${1:#markdown content here}
endsnippet
snippet :cf "Coffee-script filter" !b
:coffee-script
${1://TODO:Coffeescript code here}
endsnippet
snippet inc "embebed another jade file here" !b
include ${1:filename}.jade
endsnippet
snippet inc:mk "Include markdown content here" !b
include:markdown ${1:filename}.md
endsnippet
snippet inc:cf "Include coffee-script content here" !b
include:coffee-script ${1:filename}.coffee
endsnippet
#Mixin declararion
snippet mix "a mixin declaration" !b
mixin ${1:mixin name}
${2: //TODO: Content of mixin here}
endsnippet
snippet mixa "Mixin with arguments" !b
mixin ${1:mixin name}(${2:arguments...})
${3:element}= $2
endsnippet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment