This file contains hidden or 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
<script lang="ts"> | |
import InputError from './InputError.svelte'; | |
import { actions, type ActionReturnType } from 'astro:actions'; | |
const { result }: { | |
result: ActionReturnType<typeof actions.getGreeting> | |
} = $props(); | |
let name = $state(result?.data?.fields.name || ''); | |
let surname = $state(result?.data?.fields.surname || ''); |
This file contains hidden or 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 _init() | |
offsetx=240 | |
offsety=135 | |
x=0+offsetx | |
y=0+offsety | |
radius=50 | |
theta=0 | |
end |
This file contains hidden or 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
// Faster | |
function html() { | |
const base = arguments[0]; | |
if (!arguments[1]) return base[0]; | |
let html = base[0]; | |
for (let i = 1; i < arguments.length; i++) { | |
html += arguments[i]; | |
if (base[i]) html += base[i]; | |
} | |
return html; |
This file contains hidden or 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
.content-grid { | |
--padding: 1rem; | |
--content-max-width: 700px; | |
--breakout-max-width: 900px; | |
justify-items: center; | |
display: grid; | |
grid-auto-flow: row; | |
} | |
.content-grid > * { | |
box-sizing: border-box; |
This file contains hidden or 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 random(from = 0, to = 1) { | |
return Math.random() * (to - from) + from; | |
} | |
export default random; |
This file contains hidden or 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
# Load version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
precmd_functions+=( precmd_vcs_info ) | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats ' · %b' | |
# Set up the prompt (with git branch name) | |
setopt PROMPT_SUBST |
This file contains hidden or 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 fs from 'fs'; | |
import { IncomingForm } from 'formidable'; | |
import csvParser from 'csv-parser'; | |
export default async (req, res) => { | |
const data = await new Promise((resolve, reject) => { | |
const form = new IncomingForm() | |
form.parse(req, (err, fields, files) => { | |
if (err) return reject(err); |
This file contains hidden or 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, { createContext, useContext, useState } from "react"; | |
const Context = createContext({}); | |
export function AuthContextProvider({ children }) { | |
const [ auth, setAuth ] = useState(null); | |
return ( | |
<Context.Provider value={ { auth, setAuth } }> | |
{ children } |
This file contains hidden or 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 DEFAULT_TIMEOUT = 3000; | |
function request(resource, options = {}) { | |
const { timeout = DEFAULT_TIMEOUT } = options; | |
return fetch(resource, { ...options, signal: AbortSignal.timeout(timeout) }); | |
} | |
export default request; |
This file contains hidden or 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 { parse } from 'https://deno.land/std/flags/mod.ts'; | |
import readFileHelp from './read_file_help.ts'; | |
import readFileList from './read_file_list.ts'; | |
import readFileOutdated from './read_file_outdated.ts'; | |
import readFileUpdate from './read_file_update.ts'; | |
const args = parse(Deno.args); | |
let arg; |
NewerOlder