This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ALLOWED = { | |
| unichr(9), # 0x09 - CHARACTER TABULATION (\t) | |
| unichr(10), # 0x0A - LINE FEED (\n) | |
| unichr(13) # 0x0D - CARRIAGE RETURN (\r) | |
| } | |
| DISALLOWED = set(map(unichr, range(0,32) + range(127,160))) | { | |
| unichr(160) # 0x0A - NO-BREAK SPACE | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test: | |
| virtualenv.create: | |
| - path: /opt/cate2/ | |
| - pip: True | |
| - runas: cate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foobar: | |
| archive.tar: | |
| - sources: http://download.redis.io/releases/redis-2.8.3.tar.gz | |
| - dest: /opt/redis-2.8 | |
| ############ OUTPUT ############ | |
| State: - archive | |
| Name: REPLACEME | |
| Function: tar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root@(none):~/debian-installer-20130613+deb7u1/build# fakeroot make rebuild_netboot | |
| perl: warning: Setting locale failed. | |
| perl: warning: Please check that your locale settings: | |
| LANGUAGE = (unset), | |
| LC_ALL = (unset), | |
| LC_CTYPE = "UTF-8", | |
| LANG = (unset) | |
| are supported and installed on your system. | |
| perl: warning: Falling back to the standard locale ("C"). | |
| perl: warning: Setting locale failed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> foo = 12 | |
| >>> def func(): | |
| ... print foo | |
| ... | |
| >>> func() | |
| 12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> x = {1, 2, 3} | |
| >>> y = [3, 4, 5] | |
| >>> x.intersection(y) | |
| {3} | |
| >>> x & y | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> | |
| TypeError: unsupported operand type(s) for &: 'set' and 'list' | |
| >>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [fkochem@FK] ~/temp $ mkdir blubb †: 0 | |
| [fkochem@FK] ~/temp $ cd blubb †: 0 | |
| [fkochem@FK] ~/temp/blubb $ git init †: 0 | |
| Initialized empty Git repository in /Users/fkochem/temp/blubb/.git/ | |
| [fkochem@FK] ~/temp/blubb (git)-[master]$ touch meh †: 0 | |
| [fkochem@FK] ~/temp/blubb (git)-[master]$ cat > meh †: 0 | |
| this | |
| is | |
| my | |
| awesome |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| oldrev=$(git rev-parse $1) | |
| newrev=$(git rev-parse $2) | |
| refname="$3" | |
| case "$refname","$rev_type" in | |
| refs/tags/*,tag) | |
| # annotated tag | |
| refname_type="annotated tag" | |
| function="atag" | |
| short_refname=${refname##refs/tags/} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| f1 = 'my movie title #12' | |
| f2 = 'my other movie title' | |
| my_regex = re.compile(r'^(?P<movie>.*)( #(?P<version>\d+))$') | |
| result = re.match(my_regex, f1) | |
| if result: | |
| print result.groupdict() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import os | |
| import tornado.httpserver | |
| import tornado.web | |
| import tornado.websocket | |
| import tornado.ioloop | |
| import tornado.gen | |
| import tornadoredis | |