ziikutv
Joined 14 years ago
Joined 14 years ago
# In this example, I use blueprint plugin
@bp.route('/', methods=['PUT'])
def create_resource():
return
vs class Resource(...):
def on_put(self, request, response):
return
Mirror: https://pastebin.com/50W8TJV2Flask's hooking logic [1] is nice but I much prefer Falcon's middleware logic [2]. This then ties into the fact that Flask's design requires working with `g` [3] (essentially a global object) where as the middleware design leads us to bake in data in the request object. The example blow demonstrates how middleware definition works and how "adding data" per request works in both of these frameworks.
# Flask; assuume `app` exists
from flask import g
@app.before_request
def before_request():
g.some_variable = 'foobar'
vs class ExampleComponent(object):
def process_request(self, req, resp):
req.some_variable = 'foobar'
Mirror: https://pastebin.com/Z3yGCfzFAdditionally, Falcon middleware API also exposes `process_resource` which is similar to above but also allows us to _pass_ arguments to the routed resource instance.
[1] http://flask.pocoo.org/docs/1.0/api/#flask.Flask.before_requ...
[2] https://falcon.readthedocs.io/en/stable/api/middleware.html
[3] http://flask.pocoo.org/docs/1.0/appcontext/#storing-data
Edit: Formatting
> Scrolljacking basically means we replace native scrolling (what you’re used to) with targeted scrolling: when the user initiates a scroll, either with their mouse or keyboard, scrolljacking takes them to an exact vertical point on the screen (for example, the top of the next content container)
They aren't targeting your scrolling to specific areas on the page, just adding an ease in/out. It happens natively on iOS actually.
Edit: I do agree that it might hinder accessibility, just dont think the term applies as it does in other cases here.
http://sterlicht.alwaysdata.net/transcrypt.org/docs/html/special_facilities.html#inserting-literal-javascript-pragma-js-and-include
vs
transcrypt.org/docs/html/special_facilities.html#inserting-literal-javascript-pragma-js-and-include>>> sum([x['moons'] for x in target['system']['planets']])
Thanks for contributing to the VS Code ecosystem.
1. Syntax (missing for Elixir)
2. Shortcuts (even preferences shortcut is missing)
3. Easier configuration API; I think currently, you give us the "entire React app", rather get something simple.
I have the application downloaded; assuming you have autoupdates. I will keep an eye out; excited to see where this goes.
1. I wonder though why you/team didn't opt for extending the vim emulation - via a plugin - on VS Code. Did the exposed API limit you from doing so? Edit: Having used the extensions of VSCode, I am wondering if that is the case.
2. Does it support installation of sublime/atom/vscode plugins?
Edit: I couldn’t even spam back to get out, it would go back and then pull me forward to next question. I had to just change the URL back to HN.