This file contains hidden or 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 es = document.querySelectorAll('button[value="Undo"]'); | |
| function doo(){ | |
| for (var ei=0; ei < es.length; ei++){ | |
| var e = es[ei]; | |
| e.click(); | |
| var btnoks = document.querySelectorAll('button[value="Ok"]') | |
| if (btnoks.length > 0){ | |
| btnoks[0].click(); | |
| } | |
| if (ei == es.length - 1){ |
This file contains hidden or 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
| test |
This file contains hidden or 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
| (function (interval_min, url){ | |
| // Constants | |
| var CONTAINER_TOP_OFFSET = 30; | |
| var CONTAINER_MARGIN = 20, | |
| CONTAINER_PADDING = 10, | |
| BUTTON_CONTAINER_HEIGHT = 30; | |
| // Due to cross origin policy some site will not allow iframing - so we will create an iframe inside the same page. | |
| var body_info = {width: screen.availWidth, height: screen.availHeight }; // document.body.getBoundingClientRect();//document.getElementsByTagName("body")[0].getBoundingClientRect(); | |
| var body_width = body_info.width - (CONTAINER_MARGIN * 2) - (CONTAINER_PADDING * 2) - 20, | |
| body_height = body_info.height - (CONTAINER_MARGIN * 2) - (CONTAINER_PADDING * 2) - CONTAINER_TOP_OFFSET - BUTTON_CONTAINER_HEIGHT - 20 - 50; |
This file contains hidden or 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
| --------------------------------------------------------------------------- | |
| TypeError Traceback (most recent call last) | |
| <ipython-input-91-b6f524c4a765> in <module>() | |
| ----> 1 class Accountant(metaclass=CompanyMETA): | |
| 2 name = "" | |
| 3 salary = 150000.00 | |
| 4 | |
| <ipython-input-90-01e64576f9dc> in __new__(cls, name, parents, dct) | |
| 11 else: |
This file contains hidden or 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
| class Accountant(metaclass=CompanyMETA): | |
| name = "" | |
| salary = 150000.00 | |
This file contains hidden or 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
| class Developer(metaclass=CompanyMETA): | |
| name = "" | |
| salary = 250000 | |
This file contains hidden or 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
| class CompanyMETA(type): | |
| @classmethod | |
| def __prepare__(cls, name, parents, **kwargs): | |
| return {} | |
| def __new__(cls, name, parents, dct): | |
| for attr, value in dct.items(): | |
| if not attr.startswith("__"): | |
| if callable(value): | |
| if not attr.startswith("c_"): | |
| raise TypeError("You cannot define a method that starts with something other than 'c_'") |
This file contains hidden or 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
| class MyMeta(type): | |
| @classmethod | |
| def __prepare__(cls, name, parents, **kwargs): | |
| print("I am __prepare__ and I am being called. I must return a dictionary or dictionary like object to be used as namespace for the class") | |
| return {} | |
| def __new__(cls, name, parents, dct): | |
| print("I am a class and I am beign created by MyMeta.__new__") | |
| return super(MyMeta, cls).__new__(cls, name, parents, dct) |
This file contains hidden or 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
| class MyMeta(type): | |
| def __new__(cls, name, parents, dct): | |
| print("I am a class and I am beign created by MyMeta.__new__") | |
| return super(MyMeta, cls).__new__(cls, name, parents, dct) | |
| def __init__(cls, name, parents, dct): | |
| print("Hey I am initiating the class after creation with an useless variable") | |
| cls.useless_var = "Useless string" |
This file contains hidden or 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
| class MyMeta(type): | |
| def __new__(cls, name, parents, dct): | |
| print("I am a class and I am beign created by MyMeta.__new__") | |
| return super(MyMeta, cls).__new__(cls, name, parents, dct) | |
| class MyClass(metaclass=MyMeta): | |
| pass |