This file contains 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 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 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 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 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 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 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 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 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 |
This file contains 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) do | |
x + 10 | |
end | |
add_five = fn x -> x + 5 end | |
add_two = &(&1 + 2) | |
add_ten(10) # 20 | |
add_five.(10) # 15 | |
add_two.(10) # 12 |
NewerOlder