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
| document.querySelectorAll('[data-bs-toggle="collapse"]').forEach(button => { | |
| button.addEventListener("click", (event) => { | |
| event.preventDefault(); | |
| let targetSelector = button.getAttribute("data-bs-target"); | |
| let target = document.querySelector(targetSelector); | |
| if (target) { | |
| let isCollapsed = target.classList.contains("show"); | |
| if (isCollapsed) { | |
| collapseElement(target); |
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 { | |
| CreateMultipartUploadCommand, | |
| UploadPartCommand, | |
| CompleteMultipartUploadCommand, | |
| AbortMultipartUploadCommand, | |
| S3Client, | |
| } = require('@aws-sdk/client-s3'); | |
| const path = require('path'); | |
| const fs = require('fs'); | |
| const crypto = require('crypto'); |
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
| <!-- | |
| InfiniteScroll.svelte | |
| Author: Tom Barrasso | |
| Licensed to the Apache Software Foundation (ASF) under one | |
| or more contributor license agreements. See the NOTICE file | |
| distributed with this work for additional information | |
| regarding copyright ownership. The ASF licenses this file | |
| to you under the Apache License, Version 2.0 (the |
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
| Object.prototype[Symbol.iterator] = function() { | |
| let props = Object.getOwnPropertyNames(this); | |
| return { | |
| next: () => { | |
| let name = props.shift(); | |
| let done = (name === undefined); | |
| let value = (done) ? undefined : [name, this[name]]; | |
| return { value, done }; | |
| } | |
| } |
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 hashCode = str => Array.from(str) | |
| .reduce((h, c) => Math.imul(31, h) + c.charCodeAt(0) | 0, 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
| function zip(...arrs) { | |
| let i = -1; | |
| return { | |
| [Symbol.iterator]() { | |
| return this; | |
| }, | |
| next: () => ({ | |
| done: ++i === arrs[0].length, | |
| value: arrs.map(arr => arr[i]) | |
| }) |
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
| add_ten = fn (x) -> x + 10 end | |
| do_a_thing_to_x = fn (thing, x) -> | |
| thing.(x) | |
| end | |
| do_a_thing_to_x.(add_ten, 10) # 20 |
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 addTen = (x) => x + 10; | |
| const doAThingToX = (thing, x) => thing(x); | |
| doAThingToX(addTen, 10); // 20 |
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
| def add_ten(x \\ 10) do | |
| x + 10 | |
| end | |
| add_ten() # 20 |
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 addTen = (x = 10) => { | |
| return x + 10; | |
| }; | |
| addTen(); // 20 |
NewerOlder