Petr Messner - [email protected]
Problémy s řešením webové aplikace pomocí jQuery:
- callback hell
- problematické generování HTML
Petr Messner - [email protected]
Problémy s řešením webové aplikace pomocí jQuery:
#!/usr/bin/env python3 | |
import logging | |
import multiprocessing | |
from time import sleep | |
logger = logging.getLogger(__name__) | |
logging.basicConfig(format='%(asctime)s [%(process)d]: %(message)s', level=logging.DEBUG) |
import logging | |
from time import monotonic as monotime | |
logger = logging.getLogger(__name__) | |
class TimingWrapper: | |
''' | |
Wrapper na jakoukoli strukturu objektů, který měří dobu trvání běhu metod |
run: venv/bin/gunicorn | |
venv/bin/gunicorn -b 127.0.0.1:9000 app:my_app | |
venv/bin/gunicorn: | |
test -d venv || pyvenv-3.4 venv | |
venv/bin/pip install -U pip | |
venv/bin/pip install gunicorn |
var zmq = require('zmq'); | |
var socket = zmq.socket('dealer'); | |
socket.connect('tcp://127.0.0.1:3333'); | |
socket.on('message', function(payload) { | |
console.info('Received:', payload.toString()); | |
}); | |
console.info('Sending...'); |
def test_classic_way_with_asserts(testdb): | |
campaign_id = insert_fixture_campaign(testdb) | |
app = App(testdb) | |
response = app.get_campaign(campaign_id) | |
assert response['name'] == 'Test campaign' | |
assert response['slug'] == 'test-campaign' | |
assert response['targeting']['segment'] == 'customers' | |
# assert ... |
#!/usr/bin/env python3 | |
from collections import defaultdict, namedtuple | |
from datetime import datetime, timedelta | |
import csv | |
import sys | |
def main(): | |
flights = load_flights() |
from contextlib import contextmanager | |
import multiprocessing | |
def main(): | |
multiprocessing.current_process().name = 'master' | |
mgr = multiprocessing.Manager() | |
with setup_logging(mgr): | |
pass # do cool stuff here |
#!?usr/bin/env python3 | |
import flask | |
import json | |
app = flask.Flask(__name__) | |
@app.route('/') | |
def index(): | |
return ''' |