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
| # change directory (drag and drop a folder from the Finder after it) | |
| cd | |
| # show current directory | |
| pwd | |
| # list files | |
| ls | |
| # list files with details |
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 | |
| $states['VN'] = array( | |
| 'THANH-PHO-HUE' => __( 'Thành phố Huế', 'woo-viet' ), | |
| 'THANH-PHO-HA-NOI' => __( 'Thành phố Hà Nội', 'woo-viet' ), | |
| 'TP-CAN-THO' => __( 'Tp Cần Thơ', 'woo-viet' ), | |
| 'TP-HAI-PHONG' => __( 'Tp Hải Phòng', 'woo-viet' ), | |
| 'TP-HO-CHI-MINH' => __( 'Tp Hồ Chí Minh', 'woo-viet' ), | |
| 'TP-DA-NANG' => __( 'Tp Đà Nẵng', 'woo-viet' ), | |
| 'TINH-AN-GIANG' => __( 'Tỉnh An Giang', 'woo-viet' ), | |
| 'TINH-BAC-NINH' => __( 'Tỉnh Bắc Ninh', 'woo-viet' ), |
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() { | |
| var e = document.querySelectorAll("div[data-hiroman-lazy-render]"); | |
| if (e.length) { | |
| var t = new IntersectionObserver(function(e, t) { | |
| e.forEach(function(e) { | |
| if (e.isIntersecting) { | |
| var n = e.target.querySelector("noscript"); | |
| if (n) { | |
| var r, o = (new DOMParser).parseFromString(n.textContent, "text/html"); | |
| (r = e.target).replaceWith.apply(r, o.body.childNodes); |
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 | |
| function add_lazy_render_to_elementor_sections($element, $section_id, $args) | |
| { | |
| if (in_array($element->get_name(), ['section', 'container'])) { | |
| if (!$element->get_controls('hiroman_lazy_render')) { | |
| $element->start_controls_section('flying_press', [ | |
| 'tab' => \Elementor\Controls_Manager::TAB_ADVANCED, | |
| 'label' => esc_html__('Lazy Render HTML', 'hiroman'), | |
| ]); |
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 | |
| /* Cleaner WP header | |
| *===============================================================*/ | |
| function clean_header() { | |
| // Remove the REST API lines from the HTML Header | |
| remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); | |
| remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 ); |
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
| import {glob} from 'glob'; | |
| import {writeFileSync} from 'fs'; | |
| import {basename, resolve} from 'path'; | |
| const languages = glob.globSync(resolve(process.cwd(), './languages/*.ts')); | |
| languages.map((language:string) => { | |
| const lang = require(language).default; | |
| const langName = basename(language).split('.').shift(); | |
| writeFileSync(`./json/${langName}.json`, JSON.stringify(lang)); | |
| }); |
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
| const terminator = (signal: string) => { | |
| console.log(`Received ${signal}: ", "cleaning up`); | |
| setTimeout( | |
| (...args) => { | |
| console.log(...args); | |
| process.exit(0); | |
| }, | |
| 400, | |
| "Message" | |
| ); |
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
| setInterval(function() { | |
| if (jQuery('#wpallimport-try-again').is(':visible')) { | |
| jQuery('#wpallimport-try-again').click(); | |
| } | |
| }, 5000); |
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 | |
| // Validate Tel in Elementor form | |
| function elementor_form_validation( $record, $ajax_handler ) { | |
| $fields = $record->get_field( [ | |
| 'type' => 'tel', | |
| ] ); | |
| if ( empty( $fields ) ) { | |
| return; | |
| } | |
| $field = current( $fields ); |
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
| import { Request, Response } from 'express'; | |
| import { Body, Controller, Post, Req, Res } from '@nestjs/common'; | |
| import { UserService } from './user.service'; | |
| import * as Redis from 'ioredis'; | |
| import { RateLimiterRedis } from 'rate-limiter-flexible'; | |
| const redisClient = new Redis({enableOfflineQueue: false}); | |
| const maxWrongAttemptsByIPperDay = 100; | |
| const maxConsecutiveFailsByUsernameAndIP = 5; |
NewerOlder