blob_adminmain.tsx2 matches
60const { ValTown } = await import("npm:@valtown/sdk");
61const vt = new ValTown();
62const { email: authorEmail, profileImageUrl, username } = await vt.me.profile.retrieve();
63// const authorEmail = me.email;
64128129c.set("email", email);
130c.set("profile", { profileImageUrl, username });
131await next();
132};
blob_adminapp.tsx3 matches
437{profile && (
438<div className="flex items-center space-x-4">
439<img src={profile.profileImageUrl} alt="Profile" className="w-8 h-8 rounded-full" />
440<span>{profile.username}</span>
441<a href="/auth/logout" className="text-blue-400 hover:text-blue-300">Logout</a>
580alt="Blob content"
581className="max-w-full h-auto"
582onError={() => console.error("Error loading image")}
583/>
584</div>
630<li>Create public shareable links for blobs</li>
631<li>View and manage public folder</li>
632<li>Preview images directly in the interface</li>
633</ul>
634</div>
socialImageREADME.md11 matches
1# Simple image generator
23A bit of a toy image creator that can be used anywhere images can be, but is intended for social share images in `og:image` or `twitter:image` meta tags.
45## Usage examples
7**In a live web page**
89- Live example https://tylergaw-socialimageusage.web.val.run/
10- Live example Val https://www.val.town/v/tylergaw.socialImageUsage
1112## Code examples
14**Default**
1516This will set the `og:image` of a web page to a png image of an orange 1200x600 pixel rectangle
1718```html
19<meta property="og:image" content="https://tylergaw-socialimage.web.val.run/">
20```
2122Works the same way as an embedded image
2324```html
25<img src="https://tylergaw-socialimage.web.val.run/">
26```
2733- `bg`: Sets the background color. Default `orange`. See Color format examples below for details
34- `color`: Sets the background color. Default `black`. See Color format examples below for details
35- `w`: Sets the width of the image. Default `1200`
36- `h`: Sets the height of the image. Default `600`
37- `text`: Sets the text displayed. Default `Wellow horld`
3839```html
40<meta property="og:image" content="https://tylergaw-socialimage.web.val.run/?bg=pink&w=1000&h=400">
41```
42
socialImagemain.tsx2 matches
1export const socialImage = async (req: Request) => {
2const params = new URL(req.url).searchParams;
3// Look for values form query params, set defaults
21return new Response(canvas.toBuffer(), {
22headers: {
23"Content-Type": "image/png",
24},
25});
rss-generatorREADME.md2 matches
3rss generator that creates rss feeds for non-rss blogs
45
67#### adding new entries
14#### how it works
1516
1718#### limitations
exif-reader05_get_exif.tsx3 matches
7// how to receive files in val town
8// create form in val town
9// check if file is an image file
10// read the file with exifreader
1188<main style={pageStyles.main}>
89<h1>Serverless EXIF Reader</h1>
90<p>Read EXIF data from an image file</p>
91<p className="message">{message}</p>
92<form
167168console.log(list);
169// const imageDate = tags["DateTimeOriginal"].description;
170// const unprocessedTagValue = tags["DateTimeOriginal"].value;
171// send data values in tabular format
Sonarfarcaster.ts4 matches
6export const desc = 'Farcaster Explorer'
7// export const iconUrl = "https://imgur.com/TrJLlwp.png";
8// export const ogImageUrl = "https://imgur.com/xKVOVUE.png";
910export function embedMetadata(baseUrl: string, path: string = '/') {
11return {
12version: 'next',
13imageUrl: baseUrl + '/image?path=' + encodeURIComponent(path),
14button: {
15title: name,
18name: name,
19url: baseUrl + path,
20splashImageUrl: baseUrl + '/icon?rounded=1',
21splashBackgroundColor: '#111111',
22},
46iconUrl: baseUrl + '/icon',
47homeUrl: baseUrl,
48splashImageUrl: baseUrl + '/icon?rounded=1',
49splashBackgroundColor: '#111111',
50primaryCategory: 'social',
3Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right.
45You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen!
67Have fun with it and hopefully your crush says yes hehe.
sqlite_adminREADME.md1 match
3This is a lightweight SQLite Admin interface to view and debug your SQLite data.
45
67It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
html_in_hyde_1main.tsx18 matches
4await sqlite.execute({
5sql: `UPDATE rsvps
6SET imageb64blob = imageb64
7WHERE rowid IN (
8SELECT rowid FROM rsvps
9WHERE imageb64blob IS NULL
10LIMIT 1000
11);`,
22status TEXT NOT NULL,
23color TEXT NOT NULL,
24imageb64 TEXT
25)
26`,
77const status = formData.get("status") as string;
78const color = formData.get("color") as string;
79const image = formData.get("image") as File;
80let imageb64;
81if (image) {
82const reader = new FileReader();
83reader.readAsDataURL(image);
84imageb64 = await new Promise<string>((resolve, reject) => {
85reader.onload = () => resolve(reader.result as string);
86reader.onerror = reject;
108await sqlite.execute({
109sql:
110"UPDATE rsvps SET name = ?, email = ?, status = ?, color = ?, imageb64blob = ? WHERE email = ?",
111args: [name, email, status, color, imageb64 ?? null, email],
112});
113120await sqlite.execute({
121sql:
122"INSERT INTO rsvps (name, email, status, color, imageb64blob) VALUES (?, ?, ?, ?, ?)",
123args: [name, email, status, color, imageb64 ?? null],
124});
125133return new Response("Method Not Allowed", { status: 405 });
134}
135case "/image":
136if (req.method === "GET") {
137// the index of the image is in the query string as "index"
138const index = Number(url.searchParams.get("index"));
139const result = await sqlite.execute({
140sql: "SELECT imageb64blob FROM rsvps LIMIT 1 OFFSET ?",
141args: [index],
142});
143const image = result.rows[0][0] as string;
144145return new Response(image, {
146headers: {
147"Cache-Control": "public, max-age=31536000, immutable",
155<body>
156<a href="/rsvps">RSVPs</a>
157<a href="/images">Images</a>
158</body>
159</html>