Skip to content

Instantly share code, notes, and snippets.

View sky-code's full-sized avatar
😱
Kernel panic: …

Ihor Aleksandrov sky-code

😱
Kernel panic: …
View GitHub Profile
@sky-code
sky-code / CORS.rst
Created October 2, 2017 15:16
Cross-origin resource sharing and Same-origin policy introduction

Same-origin policy

Web security model is tightly connected to `Same-origin policy (SOP) <sop_>`__. In short: web pages cannot Read resources which origin doesn't match origin of requested page, but can Embed (or Execute) resources and have limited ability to Write resources.

Origin of a page is defined in the `Standard <cors_>`__ as tuple

def clean_mongo_field_names(dict_object: Dict) -> List[Tuple[str, str]]:
"""
Patch a field names (keys) in dict for MongoDB, replace dot (.) symbol to uFF0E unicode symbol
and dollar ($) symbol to FF04 unicode symbol if they first symbol of field name
Args:
dict_object: dict object that will be patched
See Also:
https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names
http://www.fileformat.info/info/unicode/char/ff04/index.htm
http://www.fileformat.info/info/unicode/char/ff0e/index.htm
@sky-code
sky-code / README.md
Created July 4, 2017 01:22
Chrome blank new tab extension

Save the files in empty directory, which should not be deleted while this extension in use (eg. directory "Empty new tab page" in Documents ) and:

  • Go to Chrome Extensions page (chrome://extensions/)
  • Check "Developer mode" (upper right)
  • Click "Load unpacked extension..." and point to the directory where two files was saved Developer mode now could be turned off.

Now we've got absolutely blank new tab with absolutely blank URL field.

Note: newtab.html could be customized in a suitable way.