A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
I hereby claim:
To claim this, I am signing this object:
brew remove pyqt | |
brew install pyqt #verify everything works fine | |
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH | |
brew tap homebrew/science | |
brew install qgis --with-grass --with-postgis |
[...migrations running...] | |
Running migrations for social_auth: | |
- Migrating forwards to 0002_auto__add_unique_nonce_timestamp_salt_server_url__add_unique_associati. | |
> social_auth:0001_initial | |
FATAL ERROR - The following SQL query failed: CREATE TABLE "social_auth_usersocialauth" ("id" serial NOT NULL PRIMARY KEY, "user_id" integer NOT NULL, "provider" varchar(32) NOT NULL, "uid" varchar(255) NOT NULL, "extra_data" text NOT NULL); | |
The error was: relation "social_auth_usersocialauth" already exists | |
Error in migration: social_auth:0001_initial | |
Traceback (most recent call last): | |
File "/Users/jacob/.virtualenvs/sentry_venv/bin/sentry", line 9, in <module> |
air:uwsgi-1.2.5 jacob$ ~/.virtualenvs/hestra/bin/python uwsgiconfig.py --build | |
using profile: buildconf/default.ini | |
detected include path: ['/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include', '/usr/local/include', '/usr/include', '/System/Library/Frameworks', '/Library/Frameworks'] | |
configured CFLAGS: -O2 -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_BUILD_DATE="\"09 September 2012 22:23:12\"" -DUWSGI_HAS_IFADDRS -mmacosx-version-min=10.5 -DUWSGI_LOCK_USE_OSX_SPINLOCK -DUWSGI_EVENT_USE_KQUEUE -DUWSGI_EVENT_TIMER_USE_KQUEUE -DUWSGI_EVENT_FILEMONITOR_USE_KQUEUE -DUWSGI_EMBEDDED -DUWSGI_UDP -I/usr/local/Cellar/pcre/8.31/include -DUWSGI_PCRE -DUWSGI_ROUTING -DUWSGI_UUID -DUWSGI_VERSION="\"1.2.5\"" -DUWSGI_VERSION_BASE="1" -DUWSGI_VERSION_MAJOR="2" -DUWSGI_VERSION_MINOR="5" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_ASYNC -DUWSGI_MULTICAST -DUWSGI_MINTERPRETERS -DUWSGI_INI |
(This gist is pretty old; I've written up my current approach to the Pyramid integration on this blog post, but that blog post doesn't go into the transactional management, so you may still find this useful.)
I've created a Pyramid scaffold which integrates Alembic, a migration tool, with the standard SQLAlchemy scaffold. (It also configures the Mako template system, because I prefer Mako.)
I am also using PostgreSQL for my database. PostgreSQL supports nested transactions. This means I can setup the tables at the beginning of the test session, then start a transaction before each test happens and roll it back after the test; in turn, this means my tests operate in the same environment I expect to use in production, but they are also fast.
I based my approach on [sontek's blog post](http://sontek.net/blog/
from flask import Flask | |
import sqlalchemy as sa | |
from sqlalchemy import orm | |
from sqlalchemy.ext.declarative import declarative_base | |
from flask.ext.admin import Admin | |
from flask.ext.admin.contrib import sqla | |
app = Flask(__name__) |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
<html> | |
<!-- | |
This is an example of how to make browsers | |
offer to remember password and later fill in those passwords | |
for dynamic login forms. | |
To make the browser offer to remember passwords the form should be actually submitted. | |
Since we are handling login with AJAX we don't want the form to submit, so we are still submitting it | |
into a dummmy iframe with dummy URL. | |
It's good idea to actually create empty dummy.html file, otherwise you'll flood you error.log with 404s |
Using Bootstrap Options: -c /tmp | |
Bootstrapping Salt... (this may take a while) | |
stdin: is not a tty | |
% | |
T | |
o | |
t |