I hereby claim:
- I am inklesspen on github.
- I am inklesspen (https://keybase.io/inklesspen) on keybase.
- I have a public key whose fingerprint is 0E94 44CD 2880 C204 4E57 6956 01F0 E464 7644 5757
To claim this, I am signing this object:
| >>> markupsafe.escape(u"Hello {tag}there{end}").format(tag="<a href='...'>", end="</a>") | |
| Markup('Hello <a href='...'>there</a>') | |
| >>> markupsafe.escape(u"Hello {tag}there{end}").format(tag=markupsafe.Markup("<a href='...'>"), end=markupsafe.Markup("</a>")) | |
| Markup("Hello <a href='...'>there</a>") |
I hereby claim:
To claim this, I am signing this object:
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy import create_engine | |
| from zope.sqlalchemy import register | |
| def get_sessionmaker(url, zope=True): | |
| """Configure a sessionmaker for use by requests. | |
| By default, sessions will attach themselves to the current transaction | |
| manager. Then can be turned off by setting ``zope=False``. |
There are many ways to build Pyramid apps, and knowing your options can help you make maintainable choices. Most people generate Pyramid apps using a scaffold and plug in one or two add-ons like pyramid_redis_session or pyramid_tm, but if you're interested in stepping beyond that, I'll show you some real-world examples of how we've adapted Pyramid to fit our apps.
Pyramid offers an enormous amount of customization power; most apps only use a small portion of it. I'll show you how to identify the right way to customize the framework for your particular use case and how to use this power to make your app simpler and easier to understand.
| QUERY PLAN | |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| CTE Scan on pn_downstream_thread (cost=28135.55..28281.37 rows=7291 width=8) (actual time=0.131..0.410 rows=6 loops=1) | |
| CTE pn_downstream_thread | |
| -> Recursive Union (cost=1.71..28135.55 rows=7291 width=12) (actual time=0.126..0.391 rows=6 loops=1) | |
| -> Nested Loop (cost=1.71..68.15 rows=1 width=12) (actual time=0.118..0.275 rows=2 loops=1) | |
| -> Nested Loop (cost=1.28..59.69 rows=1 width=12) (actual time=0.102..0.230 rows=3 loops=1) | |
| -> Nested Loop (cost=0.85..21.12 rows=5 width=8) (actual time=0.058..0.100 rows=12 loops=1) | |
| -> Index Scan using idx_16485_unique_asset_typ_id on ams_asset (cost=0.42..8.45 rows=1 width=8) (actual time=0.038..0.039 rows=1 loops=1) | |
| # ColorMixer | |
| # A simple RGB color mixer with three sliders. | |
| import ui | |
| import clipboard | |
| from random import random | |
| from console import hud_alert | |
| def slider_action(sender): | |
| # Get the root view: |
| jon=# \d foo | |
| Table "public.foo" | |
| Column | Type | Modifiers | |
| --------+-----------------------+-------------------------------------------------- | |
| id | integer | not null default nextval('foo_id_seq'::regclass) | |
| key | character varying(20) | not null | |
| value | character varying | not null | |
| Indexes: | |
| "foo_pkey" PRIMARY KEY, btree (id) | |
| "foo_key_key" UNIQUE CONSTRAINT, btree (key) |
| #!/usr/bin/env python | |
| """ | |
| Provide useful alembic information after switching branches. | |
| """ | |
| import argparse | |
| import subprocess | |
| import os | |
| import os.path | |
| import py.path |
| (require 'mwheel) | |
| (progn (require 'flymake-cursor) (require 'mouse) (xterm-mouse-mode t) (defun track-mouse (e)) (mouse-wheel-mode)) |