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
--- /tmp/final1 2015-07-11 13:44:21.131354076 +0200 | |
+++ /tmp/final2 2015-07-11 13:44:42.664368756 +0200 | |
@@ -233,92 +233,78 @@ | |
2315, | |
'99cab11de316dba3ac8bd1dbb921d1a7'], | |
'checker:': 'MD5Checker', | |
- 'deps:': [ 'posts/2014/10/13/revamping-my-projects-page-with-nikola.rst', | |
- 'themes/kw/templates/index.tmpl', | |
- 'posts/2011/03/05/zsh-a-shell-for-the-power-users.rst', | |
- '/home/kwpolska/git/nikola/nikola/data/themes/base-jinja/templates/comments_helper_intensedebate.tmpl', |
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
#!/usr/bin/env python3 | |
import re | |
data = """# Foo | |
Print a string. | |
```sh | |
echo "foo" | |
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
NIKOLA(1) User Commands NIKOLA(1) | |
NAME | |
Nikola - A Static Site and Blog Generator | |
SYNOPSIS | |
Create an empty site (with a setup wizard): | |
nikola init mysite |
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
#!/usr/bin/env python3 | |
from passlib.hash import bcrypt_sha256 | |
print('u/u', end='') | |
try: | |
v = bcrypt_sha256.verify('admin', '$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu') | |
print(' +' if v else ' -') | |
except TypeError: | |
print(' F') |
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
#!/usr/bin/env python3 | |
from passlib.hash import bcrypt_sha256 | |
print('u/u', end='') | |
try: | |
bcrypt_sha256.verify('admin', '$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu') | |
print(' +') | |
except TypeError: | |
print(' F') |
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
# Don’t use this, use itertools.zip_longest() instead! | |
def alternate_all(*args): | |
ls = [iter(i) for i in args] | |
stops = 0 # cheat and get 9 LOC by making this a keyword argument | |
while stops != len(ls): | |
stops = 0 | |
for l in ls: | |
try: | |
yield next(l) | |
except StopIteration: |
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
input = ['foo deinstall 1', 'foo install 2', 'bar install 3', 'bar deinstall 4', 'foo bar 5'] | |
for i in input: | |
# If the lines start or end with (de)install, you could try startswith/endswith instead. | |
if 'deinstall' in i: | |
print("Will deinstall:", i) | |
elif 'install' in i: | |
print("Will install:", i) | |
else: | |
print("Unrecognized:", i) |
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
if True: | |
if True: | |
for key, value in (("host", host,), | |
("port", port,), | |
("user", username,), | |
("password", password,),): | |
pass |
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
for key, value in ( | |
("host", host,), | |
("port", port,), | |
("user", username,), | |
("password", password,), | |
): |