Real unit test (isolation, no children render)
Calls:
- constructor
- render
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://unpkg.com/[email protected]/lib/mobx.umd.js"></script> | |
| <script> | |
| var MobxDemo = Object.create(HTMLElement.prototype); | |
| MobxDemo.attachedCallback = function() { | |
| var state = mobx.observable({ | |
| counter : parseInt(this.getAttribute("counter")) | |
| }) |
| """ | |
| twisted async/await with asyncio reactor and uvloop | |
| """ | |
| import asyncio | |
| import uvloop | |
| from asyncio.tasks import ensure_future | |
| try: | |
| # as per github source the asyncio reactor is intended to be released in future version |
| import pandas as pd | |
| def _map_to_pandas(rdds): | |
| """ Needs to be here due to pickling issues """ | |
| return [pd.DataFrame(list(rdds))] | |
| def toPandas(df, n_partitions=None): | |
| """ | |
| Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is | |
| repartitioned if `n_partitions` is passed. |
| import falcon | |
| app = falcon.API() | |
| if __name__ == '__main__': | |
| from wsgiref.simple_server import make_server | |
| server = make_server('localhost', 8000, app) | |
| print("Listening on localhost:8000") | |
| server.serve_forever() |
Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.
All files were downloaded from https://cdnjs.com and named accordingly.
Output from ls command is stripped out (irrelevant stuff)
$ ls -lhS
566K Jan 4 22:03 angular2.min.js
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
| .sidebar_newsletter_sign_up, | |
| .sidebar_subscribe, | |
| .sign-up-form-single, | |
| .signup-form--header, | |
| .signup-with-checkboxes, | |
| .skinny-sign-up, | |
| .slidedown-newsletter, | |
| .small-newsletter, | |
| .social-link-mail, | |
| .social_newsletter_box, |
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| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |