This file contains 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.5 | |
""" | |
f4hackingsolver | |
~~~~~~~~~~~~~~~ | |
Solver for the Fallout 4 Hacking Mini Game. | |
Within Fallout 4 you sometimes encounter terminals that need to be hacked. | |
When hacking a terminal you are presented with a screen that contains a | |
list of potential passwords all with the same length. |
This file contains 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
from nonlocal_ import nonlocal_ | |
def foo(): | |
a = 1 | |
def bar(): | |
nonlocal_('a') | |
a = 2 | |
bar() | |
return a |
This file contains 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 sys | |
import dis | |
import inspect | |
NO_ATTRIBUTE = object() | |
class SeparateNamedspacedMeta(type): | |
def __new__(cls, name, bases, attributes): |
This file contains 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
from flask import Flask, url_for | |
app = Flask(__name__) | |
@app.route('/', defaults={'page_no': 1}) | |
@app.route('/<int:page_no>') | |
def main(page_no): | |
print url_for('main', page_no=2) | |
return unicode(page_no) |
This file contains 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
from flask import Flask, stream_with_context, json, Response | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
def gen(): | |
yield json.dumps({'foo': 'spam'}) | |
yield json.dumps({'bar': 'eggs'}) |
This file contains 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
[program:apostle] | |
directory=/var/www/ | |
command=/var/www/env/bin/gunicorn apostle | |
user=www-data | |
autostart=True | |
autorestart=True | |
redirect_stderr=True |
This file contains 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
from flask import Flask | |
from package.db import db | |
app = Flask(__name__) | |
db.init_app(app) |
This file contains 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
from __future__ import print_function | |
from collections import OrderedDict | |
from prepareable import Prepareable | |
from six import with_metaclass, iteritems | |
class FooMeta(with_metaclass(Prepareable, type)): | |
def __new__(cls, name, bases, attributes): |
This file contains 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
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route("/") | |
def index(): | |
return "<br>".join("%s = %r" % item for item in request.args.items()) | |
This file contains 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
# coding: utf-8 | |
""" | |
pythonic.tests.test_checkers | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
:copyright: 2013 by Daniel Neuhäuser | |
:license: BSD, see LICENSE.rst for more details | |
""" | |
import os |
NewerOlder