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
// if you don't plan to upload only images : | |
/* | |
async function convertToFile(data: AsyncIterable<Uint8Array>) { | |
const chunks = []; | |
for await (const chunk of data) { | |
chunks.push(chunk); | |
} | |
return chunks; | |
} |
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
var Meter = function (props) { | |
var { | |
percent = 0, // a number between 0 and 1, inclusive | |
width = 100, // the overall width | |
height = 10, // the overall height | |
rounded = true, // if true, use rounded corners | |
color = "#0078bc", // the fill color | |
animate = false, // if true, animate when the percent changes | |
label = null // a label to describe the contents (for accessibility) | |
} = props; |
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
class AssetHeaders | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
request = Rack::Request.new(env) | |
response = @app.call(env) | |
if request.path =~ /^\/assets\// | |
# there maybe a better way to add headers |