-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
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
# assume the following directory structure where contents of doc/ | |
# and source/ are already checked into repo., with the exception | |
# of the _build directory (i,e. you can check in _themes or _sources | |
# or whatever else). | |
# | |
# proj/ | |
# source/ | |
# doc/ | |
# remove doc/_build/html if present |
This article is now published on my website: Prefer Subshells for Context.
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
def drop_into_pdb(app, exception): | |
import sys | |
import pdb | |
import traceback | |
traceback.print_exc() | |
pdb.post_mortem(sys.exc_info()[2]) | |
# somewhere in your code (probably if DEBUG is True) | |
flask.got_request_exception.connect(drop_into_pdb) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
@app.route('/login/<provider_name>', methods=['GET', 'POST']) | |
@authomatic.login('g') | |
@requires_ssl | |
def login(provider_name): | |
if g.user is not None and g.user.is_authenticated(): | |
return redirect(url_for('index')) | |
if authomatic.result: | |
if authomatic.result.error: | |
return 'Something went wrong: {0}'.format(authomatic.result.error.message) | |
if authomatic.result.user: |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
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
var R = require('ramda') | |
var one = { | |
test: { | |
a: 1, | |
b: 2 | |
}, | |
pemento: "sipi", | |
arr: ['a', 'b'] | |
} |
OlderNewer