Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

108 lines (84 sloc) 1.951 kb
snippet cl
class ${1:`Filename('$1_t', 'name')`} {
public:
$1 (${2:arguments});
virtual ~$1 ();
private:
${3:/* data */}
};
snippet def
#ifndef $1
#define ${1:SYMBOL} ${2:value}
#endif${3}
snippet do
do {
${2:/* code */}
} while (${1:/* condition */});
snippet el
else {
${1}
}
snippet for
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
${4:/* code */}
}
snippet forr
for (${1:i} = 0; ${2:$1 < 5}; $1${3:++}) {
${4:/* code */}
}
snippet fpf
fprintf(${1:stderr}, "${2:%s}\n"${3});${4}
snippet fun
${1:void} ${2:function_name} (${3})
{
${4:/* code */}
}
snippet if
if (${1:/* condition */}) {
${2:/* code */}
}
snippet main
int main (int argc, char const* argv[])
{
${1:/* code */}
return 0;
}
snippet map
std::map<${1:key}, ${2:value}> map${3};
snippet ns
namespace ${1:`Filename('', 'my')`} {
${2}
} /* $1 */
snippet once
#ifndef ${1:`toupper(Filename('', 'UNTITLED').'_'.system("/usr/bin/ruby -e 'print (rand * 2821109907455).round.to_s(36)'"))`}
#define $1
${2}
#endif /* end of include guard: $1 */
snippet pr
printf("${1:%s}\n"${2});${3}
snippet readfile
std::vector<char> v;
if (FILE *${2:fp} = fopen(${1:"filename"}, "r")) {
char buf[1024];
while (size_t len = fread(buf, 1, sizeof(buf), $2))
v.insert(v.end(), buf, buf + len);
fclose($2);
}${3}
snippet st
struct ${1:`Filename('$1_t', 'name')`} {
${2:/* data */}
}${3: /* optional variable list */};${4}
snippet t
${1:/* condition */} ? ${2:a} : ${3:b}'
snippet td
typedef ${1:int} ${2:MyCustomType};
snippet tds
typedef struct {
${2:/* data */}
} ${1:`Filename('$1_t', 'name')`};
snippet vector
std::vector<${1:char}> v${2};
snippet wh
while (${1:/* condition */}) {
${2:/* code */}
}
Jump to Line
Something went wrong with that request. Please try again.