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
| javascript:(function () {if (document.documentElement.contentEditable === false || document.designMode === "off") {document.body.contentEditable='true';document.designMode='on';void 0;} else if (document.documentElement.contentEditable === true || document.designMode === "on") {document.body.contentEditable='false';document.designMode='off';void 0;}})(); |
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 | |
| /** Disable Classic Editor Plugin for GeneratePress Elements | |
| * Prevents GeneratePress Block Elements from opening in the classic editor when using the Classic Editor plugin in WordPress. | |
| */ | |
| function disable_classic_editor_for_gp_elements($editors, $post_type) { | |
| if ('gp_elements' === $post_type) { | |
| $editors['classic_editor'] = false; | |
| $editors['block_editor'] = false; | |
| } | |
| return $editors; |
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
| // Template literal tag function that has the default behavior of a template literal. | |
| // This is useful for formatters that give special treatment to literals tagged html (or other special names). | |
| const html = (strings, ...values) => String.raw({ raw: strings }, ...values); | |
| // Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates | |
| /* VS Code Extensions that enable HTML Syntax Highlighting in Template Literals */ | |
| // Install one of these extensions to enable syntax highlighting and HTML language features in template literals: | |
| // - lit-html by Matt Bierner |
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
| /** | |
| * Converts the rows of a Google Sheet into a JSON array. | |
| * The JSON array is split into chunks of 50,000 characters due to the Google Sheets character limit. | |
| * Object keys in the JSON array will be the headers of the Google Sheet. | |
| * | |
| * @param {string} sheetName - The name of the sheet to convert. | |
| * @returns {Array.<Array.<string>>} An array of arrays, where each inner array contains a chunk of the JSON string. | |
| * Each chunk is a string of up to 50,000 characters. | |
| * | |
| * @example |
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
| // Allow <summary> tag in WordPress TinyMCE Editor | |
| function summary_tinymce_support($initArray) { | |
| // Add summary to extended_valid_elements config | |
| $ext = 'summary'; | |
| if ( isset( $initArray['extended_valid_elements'] ) ) { | |
| $initArray['extended_valid_elements'] .= ',' . $ext; | |
| } else { | |
| $initArray['extended_valid_elements'] = $ext; | |
| } |
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
| <html> | |
| <head> | |
| <style> | |
| body { | |
| margin: 0; | |
| } | |
| * { | |
| box-sizing: border-box; |
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 factorial(num) { | |
| let result = 1; | |
| for (let i = 1; i <= num; i++) { | |
| result *= i; | |
| } | |
| return result; | |
| } | |
| console.log(factorial(0)); // 1 | |
| console.log(factorial(5)); // 120 |
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
Show hidden characters
| { | |
| // See https://go.microsoft.com/fwlink/?LinkId=733558 | |
| // for the documentation about the tasks.json format | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "label": "Kill Port", | |
| "type": "shell", | |
| "windows": { | |
| "command": "for /f \"tokens=5\" %A in ('netstat -aon ^| findstr \":${input:portNumber}\" ^| more +1') do @taskkill /F /PID %A", |
NewerOlder