Skip to content

Instantly share code, notes, and snippets.

@fendy3002
Last active December 2, 2021 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fendy3002/0f4d90156fdc9ac7fe38a80b7769c639 to your computer and use it in GitHub Desktop.
Save fendy3002/0f4d90156fdc9ac7fe38a80b7769c639 to your computer and use it in GitHub Desktop.
copyed examples
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
</body>
</html>
switch({{ get("expr", "0", "<expression>") }}) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
SELECT *
FROM %s
WHERE %s
LIMIT %s OFFSET %s
ORDER BY %s;
SELECT *
FROM {{ get("table", "0", "{table}") }}
WHERE {{ get("where", "1", "{where}") }}
ORDER BY {{ get("order", "2", "{order}") }}
LIMIT {{ get("limit", "3", "{limit}") }} OFFSET {{ get("offset", "4", "{offset}") }};
class {{ get("name", "0", "MyClass") }} {
constructor() {
}
};
export const {{ get("func", "0", "myFunction") }} = {{ "async " if get("async", "1", "") }}({{ get("args", "2") }}) => {
};
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})
{% if get("type", "2") == "default" or get("type", "2") == "3" %}{#
#}import {{ get("asName", "1", get("name", "0")) }} from '{{ get("name", "0") }}';{#
#}{% elif get("type", "2") == "prop" or get("type", "2") == "2" %}{#
#}import {{"{"}} {{ get("asName", "1", get("name", "0")) }} {{"}"}} from '{{ get("name", "0") }}';{#
#}{% else %}{#
#}import * as {{ get("asName", "1", get("name", "0")) }} from '{{ get("name", "0") }}';{#
#}{% endif %}
"{{ get("name", "0") }}": { type: Sequelize.{{ get("type", "1") }}, {{ "primaryKey: true" if get("pk", "2") | length }} },
import * as React from 'react';
class {{ get("name", "0", "MyComponent") }} extends React.Components {
constructor(props) {
super(props);
}
render() {
return <></>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment