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
<html> | |
<head> | |
<title>File upload</title> | |
</head> | |
<body> | |
<input id="file" type="file" hidden onchange="onFileAttached()" /> | |
<button id="button" onclick="uploadFile()">Upload</button> | |
<div id="filename"></div> | |
</body> |
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
import { chromium } from "playwright" | |
import { fork } from "node:child_process" | |
const main = async () => { | |
if (process.argv[2] === "child") { | |
await chromium.connectOverCDP("http://localhost:12345") | |
} else { | |
const browser = await chromium.launch({ | |
args: ["--remote-debugging-port=12345"], | |
headless: false |
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
node_modules |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<!-- Based on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select --> | |
<label for="pet-select">Choose a pet:</label> | |
<select name="pets" id="pet-select" multiple> | |
<option value="">--Please choose an option--</option> | |
<option value="dog">Dog</option> |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<!-- Copied from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select --> | |
<label for="pet-select">Choose a pet:</label> | |
<select name="pets" id="pet-select"> | |
<option value="">--Please choose an option--</option> | |
<option value="dog">Dog</option> |
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
import { createServer } from "http"; | |
import { Writable } from "node:stream"; | |
import { createWriteStream } from "node:fs"; | |
const prettyMemoryUsage = (mem) => { | |
const formattedMemory = Object.entries(mem).map(([key, value]) => { | |
const formattedValue = (value / 1024 / 1024).toFixed(2); | |
return `${key}: ${formattedValue} MB`; | |
}); |
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
import React, { useMemo } from "react"; | |
import { CylinderGeometry } from "three"; | |
export const CurvedPlane = ({ | |
width, | |
height, | |
radius, | |
children, | |
}: { | |
width: number; |
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
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "rails" | |
gem "pry-byebug" | |
end | |
require "rack/test" |
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
trap 'kill "${child_pid}"; wait ${child_pid}; exit' TERM INT | |
ruby -e 'at_exit { sleep 3; p "exit" }; loop { p "sleep"; sleep 1 }' & | |
child_pid="$!" | |
sleep infinity & wait |
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
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'pry-byebug' | |
gem 'activesupport', require: %w[active_support active_support/core_ext/hash] | |
end | |
require "open3" |
NewerOlder