Recommendations of unit types per media type:
| Media | Recommended | Occasional use | Infrequent use | Not recommended |
|---|---|---|---|---|
| Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
| em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
Recommendations of unit types per media type:
| Media | Recommended | Occasional use | Infrequent use | Not recommended |
|---|---|---|---|---|
| Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
| em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
| py.test test_sample.py --collect-only # collects information test suite | |
| py.test test_sample.py -v # outputs verbose messages | |
| py.test -q test_sample.py # omit filename output | |
| python -m pytest -q test_sample.py # calling pytest through python | |
| py.test --markers # show available markers |
| """ | |
| This module provides a simple WSGI profiler middleware for finding | |
| bottlenecks in web application. It uses the profile or cProfile | |
| module to do the profiling and writes the stats to the stream provided | |
| To use, run `flask_profiler.py` instead of `app.py` | |
| see: http://werkzeug.pocoo.org/docs/0.9/contrib/profiler/ | |
| and: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvi-debugging-testing-and-profiling | |
| """ |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| <?php | |
| /* | |
| * Place this with the rest of your rules. | |
| * Doesn't need to be in an array as there are no pipes. | |
| * Password is required with a minimum of 6 characters | |
| * Should have at least 1 lowercase AND 1 uppercase AND 1 number | |
| */ | |
| $rules = [ | |
| 'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/' | |
| ]; |
| from datetime import datetime | |
| from elasticsearch_dsl import ( | |
| DocType, | |
| String, | |
| Integer, | |
| Float | |
| ) | |
| def _suffix(): |
| <?php | |
| function getRandomTimestamps($backwardDays = null) | |
| { | |
| if ( is_null($backwardDays) ) | |
| { | |
| $backwardDays = -800; | |
| } |
| # Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands | |
| # cat paths | |
| /_cat/allocation | |
| /_cat/shards | |
| /_cat/shards/{index} | |
| /_cat/master | |
| /_cat/nodes | |
| /_cat/indices | |
| /_cat/indices/{index} |
| // Run this in the F12 javascript console in chrome | |
| // if a redirect happens, the page will pause | |
| // this helps because chrome's network tab's | |
| // "preserve log" seems to technically preserve the log | |
| // but you can't actually LOOK at it... | |
| // also the "replay xhr" feature does not work after reload | |
| // even if you "preserve log". | |
| window.addEventListener("beforeunload", function() { debugger; }, false) |