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 makeObservable(target) { | |
| // 1. Initialize handlers store | |
| target[handlers] = []; | |
| // Store the handler function in array for future calls | |
| target.observe = function (handler) { | |
| this[handlers].push(handler); | |
| }; | |
| // 2. Create a proxy to handle changes |
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 if (have_posts()): while (have_posts()) : the_post(); | |
| <?php if ( has_post_thumbnail()) : // Check if thumbnail exists | |
| $image = get_the_post_thumbnail_url(); | |
| endif; ?> | |
| <article id="post-<?php the_ID(); ?>" class="project_item" style="background-image: url(<?php echo $image; ?>)"> | |
| <a href="<?php the_permalink(); ?>"> | |
| <div class="project_item_info_wrapper"> | |
| <div class="project_item_info"> |
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
| var getall = function () { | |
| var objectlist = canvas.getObjects(); | |
| var tablelist = '<table><tr><th>Name</th><th>ID</th><th>src</th></tr>' | |
| objectlist.forEach(function (element) { | |
| console.log(element); | |
| tablelist += '<tr><td>'; | |
| if (element.type != 'rect' & element.type != 'circle' & element.type != 'text') | |
| tablelist += element._element.name; | |
| else | |
| tablelist += element.type; |
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
| // 1 | |
| function arrayWithRanges(array) { | |
| if (!array || !Array.isArray(array)) return; | |
| let num = [...array]; | |
| let k = 0; | |
| let lastElement = num.length - 1; | |
| for (var i = lastElement; i >= 0; i--) { | |
| if (num[i] == num[i - 1] + 1) { |
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 wrap(top, selector, bottom){ | |
| var matches = document.querySelectorAll(selector); | |
| for (var i = 0; i < matches.length; i++){ | |
| var modified = top + matches[i].outerHTML + bottom; | |
| matches[i].outerHTML = modified; | |
| } | |
| } | |
| wrap("<div class='wrapper'>", ".getWrapped", "</div>"); |
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 wrap(top, selector, bottom){ | |
| var matches = document.querySelectorAll(selector); | |
| for (var i = 0; i < matches.length; i++){ | |
| var modified = top + matches[i].outerHTML + bottom; | |
| matches[i].outerHTML = modified; | |
| } | |
| } | |
| wrap("<div class='wrapper'>", ".getWrapped", "</div>"); |