| `*/15 * * * *` | every 15 mins |
| `0 */2 * * *` | every 2 hours |
| `0 18 * * 0-6` | every week Mon-Sat at 6pm |
-| `10 2 * * 6,7` | every Sat and Thu on 2:10am |
+| `10 2 * * 6,7` | every Sat and Sun on 2:10am |
| `0 0 * * 0` | every Sunday midnight |
| --- | --- |
| `@reboot` | every reboot |
```bash
-v # --verbose
-vv # Even more verbose
--s # --silent
+-s # --silent: don't show progress meter or errors
+-S # --show-error: when used with --silent (-sS), show errors but no progress meter
```
```bash
--- /dev/null
+---
+title: GNU grep
+category: CLI
+layout: 2017/sheet
+updated: 2021-08-23
+---
+
+### Usage
+{: .-prime}
+
+```bash
+grep <options> pattern <file...>
+```
+
+### Matching options
+
+```bash
+-e, --regexp=PATTERN
+-f, --file=FILE
+-i, --ignore-case
+-v, --invert-match
+-w, --word-regexp
+-x, --line-regexp
+```
+
+### Pattern options
+
+```bash
+-F, --fixed-strings # list of fixed strings
+-G, --basic-regexp # basic regular expression (default)
+-E, --extended-regexp # extended regular expression
+-P, --perl-regexp # perl compatible regular expression
+```
+
+### Expressions
+
+#### Basic Regular Expressions (BRE)
+
+In BRE, these characters have a special meaning unless they are escaped with a backslash:
+
+`^ $ . * [ ] \`
+
+However, these characters do not have any special meaning unless they are escaped with a backslash:
+
+`? + { } | ( )`
+
+#### Extended Regular Expressions (ERE)
+
+ERE gives all of these characters a special meaning unless they are escaped with a backslash:
+
+`^ $ . * + ? [ ] ( ) | { }`
+
+#### Perl Compatible Regular Expressions (PCRE)
+
+PCRE has even more options such as additional anchors and character classes, lookahead/lookbehind, conditional expressions, comments, and more. See the [regexp cheatsheet](/regexp).
+
+### Output Options
+
+```bash
+-c, --count # print the count of matching lines. suppresses normal output
+ --color[=WHEN] # applies color to the matches. WHEN is never, always, or auto
+-m, --max-count=NUM # stop reading after max count is reached
+-o, --only-matching # only print the matched part of a line
+-q, --quiet, --silent
+-s, --no-messages # suppress error messages about nonexistent or unreadable files
+```
+
+### Context Options
+
+```bash
+-B NUM, --before-context=NUM # print NUM lines before a match
+-A NUM, --after-context=NUM # print NUM lines after a match
+-C NUM, -NUM, --context=NUM # print NUM lines before and after a match
+```
+
+### Examples
+
+```bash
+# Case insensitive: match any line in foo.txt
+# that contains "bar"
+grep -i bar foo.txt
+
+# match any line in bar.txt that contains
+# either "foo" or "oof"
+grep -E "foo|oof" bar.txt
+
+# match anything that resembles a URL in
+# foo.txt and only print out the match
+grep -oE "https?:\/\/((\w+[_-]?)+\.?)+" foo.txt
+
+# can also be used with pipes:
+# match any line that contains "export" in
+# .bash_profile, pipe to another grep that
+# matches any of the first set of matches
+# containing "PATH"
+grep "export" .bash_profile | grep "PATH"
+
+# follow the tail of server.log, pipe to grep
+# and print out any line that contains "error"
+# and include 5 lines of context
+tail -f server.log | grep -iC 5 error
+```
--- /dev/null
+---
+title: jinja
+category: python
+layout: 2017/sheet
+---
+
+{% raw %}
+### Basic usage
+
+```
+- variable x has content: {{ x }}
+- expression: {{ x + 1 }}
+- escaped for HTML: {{ x | e }}
+```
+
+### Control structures
+
+```
+{% for x in range(5) %}
+ {% if x % 2 == 0 %}
+ {{ x }} is even!
+ {% else %}
+ {{ x }} is odd!
+ {% endif %}
+{% endfor %}
+```
+
+### Whitespace trimming
+
+```
+these are
+{{ "three" }}
+lines.
+
+this is conc
+{{- "at" -}}
+enated.
+```
+
+### Special blocks
+
+```
+{% filter e %}{% endraw %}
+{ {%- if 0 -%}{%- endif -%} % raw %}
+{%- raw -%}
+ This is a raw block where {{nothing is evaluated}}
+ {% not even this %}
+ and <html is escaped> too with "e" filter
+{% endraw %}
+{ {%- if 0 -%}{%- endif -%} % endraw %}{% raw %}
+{% endfilter %}
+
+{% macro myfunc(x) %}
+ this is a reusable macro, with arguments: {{x}}
+{% endmacro %}
+
+{{ myfunc(42) }}
+
+{#
+this is a comment
+#}
+```
+
+
+### Inheritance
+
+#### shared.html
+
+```
+<html>
+ <head>
+ <title>{%block title %}{% endblock %}</title>
+ </head>
+ <body>
+ <header><h1>{% block title %}{% endblock %}</h1></header>
+ <main>{% block content %}{% endblock %}</main>
+ </body>
+</html>
+```
+
+#### home.html
+
+```
+{% extends "shared.html" %}
+{% block title %}Welcome to my site{% endblock %}
+{% block content %}
+This is the body
+{% endblock %}
+```
+
+## Library
+
+### Basic usage
+
+```python
+from jinja2 import Template
+template = Template('Hello {{ name }}!')
+template.render(name='John Doe') == u'Hello John Doe!'
+```
+
+{% endraw %}
--- /dev/null
+---
+title: jinja
+category: python
+redirect_to: /jinja
+---
* This is a function.
*
* @param {string} n - A string param
+ * @param {string} [o] - A optional string param
+ * @param {string} [d=DefaultValue] - A optional string param
* @return {string} A good string
*
* @example
* foo('hello')
*/
-function foo(n) {
+function foo(n, o, d) {
return n
}
```
--- /dev/null
+---
+title: mako
+category: python
+layout: 2017/sheet
+---
+
+### Basic usage
+
+```
+Variable x has content: ${x}
+Expression: ${x + 1}
+Escaped for HTML: ${x | h}
+```
+
+### Control structures
+
+```html
+% for x in range(5):
+ % if x % 2 == 0:
+ ${x} is even!
+ % else:
+ ${x} is odd!
+ % endif
+% endfor
+```
+
+### Including Python code
+
+```python
+<%
+ greeting = "Hello world!"
+ # arbitrary python code
+%>
+
+<%!
+# arbitrary python code run at toplevel
+# cannot access variables!
+
+def sign_string(number):
+ if number > 0:
+ return "positive"
+ elif number < 0:
+ return "negative"
+ else:
+ return "zero"
+%>
+```
+
+### Special blocks
+
+```html
+<%text filter="h">
+ This is a raw block where ${nothing is evaluated}
+ <%
+ not even this
+ %>
+ and <html is escaped> too with "h" filter
+</%text>
+
+<%def name="myfunc(x)">
+ this is a reusable macro, with arguments: ${x}
+</%def>
+
+${myfunc(42)}
+
+<%doc>
+ this is a comment
+</%doc>
+```
+
+### Inheritance
+
+#### shared.html
+
+```html
+<html>
+ <head>
+ <title><%block name="title" /></title>
+ </head>
+ <body>
+ <header><h1><%block name="title" /></h1></header>
+ <main>${self.body()}</main>
+ </body>
+</html>
+```
+
+#### home.html
+
+```html
+<%inherit file="shared.html" />
+<%block name="title">Welcome to my site</%block>
+
+This is the body
+```
+
+#### article.html
+
+```html
+<%inherit file="shared.html" />
+<%block name="title">${post.title}</%block>
+
+${post.content}
+```
+
+## Library
+
+### Basic usage
+
+```python
+from mako.template import Template
+
+mytemplate = Template("hello, ${name}!")
+print(mytemplate.render(name="jack"))
+```
" a: prefix for arguments
echo "Command: " . a:cmd
- return true
+ return 1
endfunction
```