Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
| // It is important to declare your variables. | |
| (function() { | |
| var foo = 'Hello, world!'; | |
| print(foo); //=> Hello, world! | |
| })(); | |
| // Because if you don't, the become global variables. | |
| (function() { |
| %% Author: bokner | |
| %% Created: Apr 10, 2010 | |
| %% Description: HTTP digest authentication | |
| %% Note: the code follows the informal explanation given on Wikipedia. | |
| %% Note: the test/0 function doesn't intend to send a proper data to webdav service, | |
| %% it just shows how to pass the authorization. | |
| %% Disclaimer: Use on your own risk. The author disclaims any liability | |
| %% with regard to using this code. | |
| -module(digest_auth). |
| """ | |
| Creating a SleekXMPP Plugin | |
| This is a minimal implementation of XEP-0077 to serve | |
| as a tutorial for creating SleekXMPP plugins. | |
| """ | |
| from . import base | |
| from .. xmlstream.handler.callback import Callback | |
| from .. xmlstream.matcher.xpath import MatchXPath |
| /** Class: Strophe.WebSocket | |
| * XMPP Connection manager. | |
| * | |
| * Thie class is the main part of Strophe. It manages a BOSH connection | |
| * to an XMPP server and dispatches events to the user callbacks as | |
| * data arrives. It supports SASL PLAIN, SASL DIGEST-MD5, and legacy | |
| * authentication. | |
| * | |
| * After creating a Strophe.Connection object, the user will typically | |
| * call connect() with a user supplied callback to handle connection level |
| # ======================================== | |
| # Testing n-gram analysis in ElasticSearch | |
| # ======================================== | |
| curl -X DELETE localhost:9200/ngram_test | |
| curl -X PUT localhost:9200/ngram_test -d ' | |
| { | |
| "settings" : { | |
| "index" : { | |
| "analysis" : { |
Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
| ''' | |
| email send service library. Using SMTP. | |
| author: yaowei | |
| last modify: 2012-07-30 | |
| ''' | |
| import datetime | |
| import logging | |
| import os |
Mar 2nd, 2009
An efficient workflow for developers in Agile teams that handles features and bugs while keeping a clean and sane history.
At Hashrocket we use git both internally and in our Agile mentoring and training. Git gives us the flexibility to design a version control workflow that meets the needs of either a fully Agile team or a team
This demonstrates that you can configure a Flask application through Flask-Script, without having to create a Flask instance or deal with circular dependencies. Note that Flask-Script's Manager accepts a factory function in place of a Flask app object.
Running:
python manage.py runserver
gives "Hello, world!" on http://localhost:5000/, while running:
python manage.py runserver -c development.cfg
| """ | |
| Demo of json_required decorator for API input validation/error handling | |
| """ | |
| import inspect | |
| import functools | |
| import json | |
| from traceback import format_exception | |
| from flask import jsonify, request | |
| import sys |