sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
1// import { Request, Response } from "./node_modules/express/index.js";
2export default async function(req: Request): Promise<Response> {
3console.log("Request received:", req);
4
89<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
90<script>
91document.addEventListener('DOMContentLoaded', function () {
92if (typeof THREE === 'undefined') {
93console.error('THREE is not defined. Make sure Three.js is loaded correctly.');
106const debugElement = document.getElementById('debug');
107108function createTextureCanvas() {
109const canvas = document.createElement('canvas');
110const ctx = canvas.getContext('2d');
130}
131132function init() {
133scene = new THREE.Scene();
134camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
163}
164165function onMouseMove(event) {
166currentPoint.set(event.clientX, window.innerHeight - event.clientY);
167if (isPressed) {
172}
173174function onMouseDown(event) {
175isPressed = true;
176clickPoint.set(event.clientX, window.innerHeight - event.clientY);
181}
182183function onMouseUp() {
184isPressed = false;
185}
186187function updateUniforms() {
188if (material) {
189material.uniforms.uClickPoint.value = clickPoint;
194}
195196function onWindowResize() {
197const width = window.innerWidth;
198const height = window.innerHeight;
204}
205206function animate() {
207requestAnimationFrame(animate);
208
SagaImmoScrapermain.tsx2 matches
3import { JSDOM } from "npm:jsdom";
45export async function scrapeSAGA(
6areas: Area[],
7maxPrice: number,
59}
6061function parsePriceToNumber(priceString: string): number {
62const val = +priceString.replace(/[^0-9,]/g, "").replace(",", ".");
63return isNaN(val) ? 0 : val;
videoStoragemain.tsx6 matches
22)`);
2324export function rowObjects(data) {
25return data.rows.map(row => {
26return data.columns.reduce((obj, column, index) => {
37}
3839export async function createVideo(webhook: Mux.Webhooks.VideoUploadCreatedWebhookEvent) {
40const {
41environment,
65}
6667export async function updateVideoCreated(webhook: Mux.Webhooks.VideoUploadAssetCreatedWebhookEvent) {
68const sql = `
69UPDATE videos
8990// Just returns the sql statement itself so that we can use `batch` in our backfill script.
91export function backfillVideo(asset: Mux.Video.Asset) {
92const sql = `
93INSERT OR IGNORE INTO videos (
156// This is just an upsert in case somehow we get an asset created webhook from something other
157// than our direct upload process.
158export async function updateVideoReady(webhook: Mux.Webhooks.VideoAssetReadyWebhookEvent) {
159const sql = `
160INSERT INTO videos (
243}
244245export async function getAllVideos() {
246const data = await sqlite.execute(`select * from videos`);
247
89<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
90<script>
91document.addEventListener('DOMContentLoaded', function () {
92if (typeof THREE === 'undefined') {
93console.error('THREE is not defined. Make sure Three.js is loaded correctly.');
106const debugElement = document.getElementById('debug');
107108function createTextureCanvas() {
109const canvas = document.createElement('canvas');
110const ctx = canvas.getContext('2d');
130}
131132function init() {
133scene = new THREE.Scene();
134camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
163}
164165function onMouseMove(event) {
166currentPoint.set(event.clientX, window.innerHeight - event.clientY);
167if (isPressed) {
172}
173174function onMouseDown(event) {
175isPressed = true;
176clickPoint.set(event.clientX, window.innerHeight - event.clientY);
181}
182183function onMouseUp() {
184isPressed = false;
185}
186187function updateUniforms() {
188if (material) {
189material.uniforms.uClickPoint.value = clickPoint;
194}
195196function onWindowResize() {
197const width = window.innerWidth;
198const height = window.innerHeight;
204}
205206function animate() {
207requestAnimationFrame(animate);
208
31the simplest way to achieve the goal, though you can add some inline comments to explain your
32reasoning (not for every line, but for major groups of lines). Don't use any environment variables
33unless strictly necessary, for example use APIs that don't require a key, prefer internal function
34imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
35functions where possible. Unless specified, don't add error handling,
36make sure that errors bubble up to the caller.
37There should be no comments like "more content here", it should be complete and directly runnable.
38The val should create a "export default async function main" which is the main function that gets
39executed on every HTTP request.
40`.replace("\n", " ");
4142// Your response should start with \`\`\`ts and end with \`\`\`.
43// The val should create a "export default async function main() {" which
44// is the main function that gets executed, without any arguments. Don't return a Response object,
45// just return a plain Javascript object, array, or string.
4683const writer = writable.getWriter();
84const textEncoder = new TextEncoder();
85function write(text) {
86writer.write(textEncoder.encode(text));
87}
149</div>
150<script>
151function updateValName(valName) {
152const valUrl = valName ? \`https://val.town/v/${username}/\${valName}\` : "";
153const previewUrl = valName ? \`https://${username}-\${valName}.web.val.run\` : "";
157document.getElementById('open-link').href = previewUrl;
158}
159function saveVal() {
160if (window.codeMirrorEditor) {
161document.getElementById("save-icon").classList.remove("hidden");
177return false;
178})
179function openTab(tab) {
180const tabButtonCode = document.getElementById("tab-button-code");
181const tabButtonPreview = document.getElementById("tab-button-preview");
197}
198}
199function toggleTab() {
200openTab(document.getElementById("tab-panel-code").style.visibility === "visible" ? "preview" : "code");
201}
255(() => {
256const scrollingElement = document.getElementById("conversation-container");
257const callback = function (mutationsList, observer) {
258scrollingElement.scrollTo({ left: 0, top: scrollingElement.scrollHeight, behavior: "instant" });
259};
328window.setCodeMirrorContent({ doc: '', old: ''});
329let fullStr = "";
330window.addToken = function(str) {
331fullStr += str;
332const code = fullStr.replaceAll("\`\`\`ts\\n", "").replaceAll("\`\`\`", "");
31the simplest way to achieve the goal, though you can add some inline comments to explain your
32reasoning (not for every line, but for major groups of lines). Don't use any environment variables
33unless strictly necessary, for example use APIs that don't require a key, prefer internal function
34imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
35functions where possible. Unless specified, don't add error handling,
36make sure that errors bubble up to the caller.
37There should be no comments like "more content here", it should be complete and directly runnable.
38The val should create a "export default async function main" which is the main function that gets
39executed on every HTTP request.
40`.replace("\n", " ");
4142// Your response should start with \`\`\`ts and end with \`\`\`.
43// The val should create a "export default async function main() {" which
44// is the main function that gets executed, without any arguments. Don't return a Response object,
45// just return a plain Javascript object, array, or string.
4684const writer = writable.getWriter();
85const textEncoder = new TextEncoder();
86function write(text) {
87writer.write(textEncoder.encode(text));
88}
164</div>
165<script>
166function updateValName(valName) {
167const valUrl = valName ? \`https://val.town/v/${username}/\${valName}\` : "";
168const previewUrl = valName ? \`https://${username}-\${valName}.web.val.run\` : "";
172document.getElementById('open-link').href = previewUrl;
173}
174function saveVal() {
175if (window.codeMirrorEditor) {
176document.getElementById("save-icon").classList.remove("hidden");
192return false;
193})
194function openTab(tab) {
195const tabButtonCode = document.getElementById("tab-button-code");
196const tabButtonPreview = document.getElementById("tab-button-preview");
212}
213}
214function toggleTab() {
215openTab(document.getElementById("tab-panel-code").style.visibility === "visible" ? "preview" : "code");
216}
270(() => {
271const scrollingElement = document.getElementById("conversation-container");
272const callback = function (mutationsList, observer) {
273scrollingElement.scrollTo({ left: 0, top: scrollingElement.scrollHeight, behavior: "instant" });
274};
343window.setCodeMirrorContent({ doc: '', old: ''});
344let fullStr = "";
345window.addToken = function(str) {
346fullStr += str;
347const code = fullStr.replaceAll("\`\`\`ts\\n", "").replaceAll("\`\`\`", "");
31the simplest way to achieve the goal, though you can add some inline comments to explain your
32reasoning (not for every line, but for major groups of lines). Don't use any environment variables
33unless strictly necessary, for example use APIs that don't require a key, prefer internal function
34imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
35functions where possible. Unless specified, don't add error handling,
36make sure that errors bubble up to the caller.
37There should be no comments like "more content here", it should be complete and directly runnable.
38The val should create a "export default async function main" which is the main function that gets
39executed on every HTTP request.
40`.replace("\n", " ");
4142// Your response should start with \`\`\`ts and end with \`\`\`.
43// The val should create a "export default async function main() {" which
44// is the main function that gets executed, without any arguments. Don't return a Response object,
45// just return a plain Javascript object, array, or string.
4683const writer = writable.getWriter();
84const textEncoder = new TextEncoder();
85function write(text) {
86writer.write(textEncoder.encode(text));
87}
174</div>
175<script>
176function updateValName(valName) {
177const valUrl = valName ? \`https://val.town/v/${username}/\${valName}\` : "";
178const previewUrl = valName ? \`https://${username}-\${valName}.web.val.run\` : "";
182document.getElementById('open-link').href = previewUrl;
183}
184function saveVal() {
185if (window.codeMirrorEditor) {
186document.getElementById("save-icon").classList.remove("hidden");
202return false;
203})
204function openTab(tab) {
205const tabButtonCode = document.getElementById("tab-button-code");
206const tabButtonPreview = document.getElementById("tab-button-preview");
222}
223}
224function toggleTab() {
225openTab(document.getElementById("tab-panel-code").style.visibility === "visible" ? "preview" : "code");
226}
280(() => {
281const scrollingElement = document.getElementById("conversation-container");
282const callback = function (mutationsList, observer) {
283scrollingElement.scrollTo({ left: 0, top: scrollingElement.scrollHeight, behavior: "smooth" });
284};
32the simplest way to achieve the goal, though you can add some inline comments to explain your
33reasoning (not for every line, but for major groups of lines). Don't use any environment variables
34unless strictly necessary, for example use APIs that don't require a key, prefer internal function
35imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
36functions where possible. Unless specified, don't add error handling,
37make sure that errors bubble up to the caller.
38There should be no comments like "more content here", it should be complete and directly runnable.
39The val should create a "export default async function main() {" which
40is the main function that gets executed on every HTTP request.
41`.replace("\n", " ");
4279const writer = writable.getWriter();
80const textEncoder = new TextEncoder();
81function write(text) {
82writer.write(textEncoder.encode(text));
83}
143</div>
144<script>
145function updateValName(valName) {
146const valUrl = valName ? \`https://val.town/v/${username}/\${valName}\` : "";
147const previewUrl = valName ? \`https://${username}-\${valName}.web.val.run\` : "";
151document.getElementById('open-link').href = previewUrl;
152}
153function saveVal() {
154if (window.codeMirrorEditor) {
155document.getElementById("save-icon").classList.remove("hidden");
171return false;
172})
173function openTab(tab) {
174const tabButtonCode = document.getElementById("tab-button-code");
175const tabButtonPreview = document.getElementById("tab-button-preview");
191}
192}
193function toggleTab() {
194openTab(document.getElementById("tab-panel-code").classList.contains("hidden") ? "code" : "preview");
195}
250(() => {
251const scrollingElement = document.getElementById("conversation-container");
252const callback = function (mutationsList, observer) {
253scrollingElement.scrollTo({ left: 0, top: scrollingElement.scrollHeight, behavior: "instant" });
254};
322window.setCodeMirrorContent({ doc: '', old: ''});
323let fullStr = "";
324window.addToken = function(str) {
325fullStr += str;
326const code = fullStr.replaceAll("\`\`\`ts\\n", "").replaceAll("\`\`\`", "");