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
| <?php | |
| //Sometimes we need to submit only part of the form. Sure, if form has #required fields, all they will be highlighted with red, | |
| //and form will not be submitted if these elements have no value. | |
| //To workaround this, we can use '#limit_validation_errors' option AND custom submit function for every 'Partial Submit' button. | |
| //Interesting note: when we use '#limit_validation_errors', we will see ALL form fields in _validate function, | |
| //but in _submit function will be visible ONLY elements, included in '#limit_validation_errors' array!!! | |
| //Case 1. The most simple. | |
| //We want to make a 'reset' button, or 'previous step' button, so it must work even if some REQUIRED form elements are empty: |
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
| // Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I) | |
| if(!!window.React || | |
| !!document.querySelector('[data-reactroot], [data-reactid]') || | |
| Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer'))) | |
| ) | |
| console.log('React.js'); | |
| if(!!document.querySelector('script[id=__NEXT_DATA__]')) | |
| console.log('Next.js'); |
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
| #how to specify an ssh key to use when cloning a repo in Mac | |
| ssh-agent bash -c 'ssh-add /Users/UR_USERNAME/.ssh/UR_PRIVATE_KEY; git clone git@DAS_GIT_URL' | |