Quick guide on how to setup git signing. Information is aggregated from following sources:
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 | |
| // SOURCE: https://gist.github.com/seebz/c00a38d9520e035a6a8c | |
| class iCal | |
| { | |
| /** | |
| * @var string | |
| */ | |
| public $title; |
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
| /** | |
| * Selectors for all focusable elements | |
| * @type {string} | |
| */ | |
| const FOCUSABLE_ELEMENT_SELECTORS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]'; | |
| const KEY_CODE_MAP = { | |
| TAB: 9 | |
| }; |
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
| pipeline { | |
| agent any | |
| stages { | |
| stage('Prepare') { | |
| steps { | |
| sh 'composer install' | |
| sh 'rm -rf build/api' | |
| sh 'rm -rf build/coverage' | |
| sh 'rm -rf build/logs' |
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 | |
| /** | |
| * Duplicates a post & its meta and returns the new duplicated Post ID. | |
| * | |
| * @param int $post_id The Post ID you want to clone. | |
| * @return int The duplicated Post ID. | |
| */ | |
| function duplicate_post(int $post_id): int | |
| { |
- For your local dev, create a
Dockerfilethat is based on your production image and simply installxdebuginto it. Exemple:
FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
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 | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Sharing Laravel's session and checking authentication | |
| |-------------------------------------------------------------------------- | |
| | | |
| | Use the following code in any CMS (WordPress, Joomla, etc), filemanager (CKFinder, | |
| | KCFinder, simogeos's Filemanager, etc), or any other non-Laravel project to boot into | |
| | the Laravel framework, with session support, and check if the user is authenticated. |
NewerOlder