Install Ruby and Bundler at the user level
Deprecated in favor of: gist.
Steps:
- Install Ruby at the user level.
| services: | |
| mysql: | |
| image: mysql:8.4.3 | |
| restart: always | |
| ports: | |
| - 3306:3306 | |
| volumes: | |
| - ./mysql:/var/lib/mysql | |
| environment: | |
| - MYSQL_ROOT_PASSWORD=root |
| <?php | |
| /** | |
| * Call a shortcode function by tag name. | |
| * | |
| * @param string $tag The shortcode whose function to call. | |
| * @param array $atts The attributes to pass to the shortcode function. Optional. | |
| * @param array $content The shortcode's content. Default is null (none). | |
| * | |
| * @return string|bool False on failure, the result of the shortcode on success. | |
| */ |
| <?php | |
| /** | |
| * Disable elementor registered widget. | |
| * | |
| * This will disable all WordPress native widgets | |
| * | |
| * @param \Elementor\Widgets_Manager $widgets_manager Instance of elementor widgets manager | |
| * | |
| * @author obiPlabon <https://obiPlabon.im> | |
| * |
| <?php | |
| /** | |
| * Asssign any elementor widget to a different category | |
| * | |
| * To override the existing category just pass [ 'your-custom-category' ] | |
| * And to keep existing [ 'your-custom-category', 'basic' ] | |
| * here 'your-custom-category' is any registered category slug | |
| * | |
| * @param array $config |
| app.use((request, response, next) => { | |
| // wheather `req.write` / `req.send` / `req.json`, express calls underlying `socket.write` | |
| // thus intercepting `socket.write` | |
| const backup = response.socket.write; | |
| let code; | |
| function newWriter(...args) { | |
| for (const arg of args) { | |
| if (typeof arg === 'string') { |
Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions
except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'
/**
* Matches following attributes in Markdown-typed image: [, alt, src, title]
*| // Click event happened in iframe won't propagate to the containing element of it. | |
| // This script provides a workaround to simulate the propagation of click event of iframe. | |
| // | |
| // inspired by https://gist.github.com/jaydson/1780598#gistcomment-2609301 | |
| (function ($) { | |
| var selector = '[data-event-category][data-event-action]'; | |
| var $elementsContainIframe = $(selector).filter(function () { | |
| return $(this).find('iframe,script').length; |
| <?php | |
| /** | |
| * Adding custom icon to icon control in Elementor | |
| */ | |
| function modify_icon_controls($controls_registry) { | |
| //3696 material design icon classes | |
| $material_design_icons_cls = 'mdi mdi-access-point, mdi mdi-access-point-network, mdi mdi-access-point-network-off, mdi mdi-account, mdi mdi-account-alert, mdi mdi-account-alert-outline, mdi mdi-account-arrow-left, mdi mdi-account-arrow-left-outline, mdi mdi-account-arrow-right, mdi mdi-account-arrow-right-outline, mdi mdi-account-badge, mdi mdi-account-badge-alert, mdi mdi-account-badge-alert-outline, mdi mdi-account-badge-horizontal, mdi mdi-account-badge-horizontal-outline, mdi mdi-account-badge-outline, mdi mdi-account-box, mdi mdi-account-box-multiple, mdi mdi-account-box-outline, mdi mdi-account-card-details, mdi mdi-account-card-details-outline, mdi mdi-account-check, mdi mdi-account-check-outline, mdi mdi-account-child, mdi mdi-account-child-circle, mdi mdi-account-circle, mdi mdi-account-circle-outline, mdi mdi-account-clock, mdi mdi-account-clock- |
| <?php | |
| // This example will add a custom "select" drop down & "switcher" to the "testimonial" section | |
| // and add custom "color" to the "testimonial style" section | |
| add_action('elementor/element/before_section_end', 'add_control_in_existing_widget', 10, 3 ); | |
| function add_control_in_existing_widget( $section, $section_id, $args ) { | |
| if( $section->get_name() == 'testimonial' && $section_id == 'section_testimonial' ){ | |
| // we are at the end of the "section_testimonial" area of the "testimonial" | |
| $section->add_control( | |
| 'testimonial_name_title_pos' , | |
| [ |