slack-prgithub-slack-pr-approvals.ts7 matches
4142// Main handler for HTTP requests
43export default async function(req: Request): Promise<Response> {
44console.log("\n๐ ========== NEW REQUEST ==========");
45console.log("๐ Request received:", req.method, "URL:", req.url);
172173// Handle GitHub PR review events
174async function handlePullRequestReview(req: Request): Promise<Response> {
175try {
176console.log("๐ Starting PR review handler");
262263// Handle Slack interactive button clicks
264async function handleSlackInteraction(req: Request): Promise<Response> {
265try {
266console.log("๐ Starting Slack interaction handler");
327
328// Perform the merge operation
329console.log("๐ Calling mergePR function");
330try {
331const mergeResult = await mergePR(repository, parseInt(pr_number, 10));
361362// Fetch detailed PR information including checks status
363async function fetchPRDetails(repo: string, prNumber: number) {
364console.log(`๐ Starting fetchPRDetails for PR #${prNumber} in ${repo}`);
365
447448// Merge a PR via GitHub API
449async function mergePR(repo: string, prNumber: number) {
450console.log(`๐ Starting mergePR for PR #${prNumber} in ${repo}`);
451
567568// Send notification to Slack
569async function sendSlackNotification(data: {
570reviewer: string;
571prNumber: number;
TownieuseAuth.tsx1 match
5const ANTHROPIC_KEY = "anthropic_api_key";
67export function useAuth() {
8const [token, setToken, removeToken] = useLocalStorage(TOKEN_KEY, "");
9const [anthropicApiKey, setAnthropicApiKey, removeAnthropicApiKey] = useLocalStorage(ANTHROPIC_KEY, "");
testProj2testroot.ts1 match
1export default async function (req: Request): Promise<Response> {
2console.log("test");
3return new Response(
2import type { ReactNode } from "npm:react@18.2.0";
34export function Layout({ children }: { children: ReactNode }) {
5return (
6<html lang="en">
markdownBlogStarterindex.tsx3 matches
5import { Layout } from "./Layout.tsx";
67function PostComponent({ markdown, link }: { markdown: string; link?: string }) {
8return (
9<div style={{ border: "1px solid gray", padding: "10px", marginBottom: "20px", borderRadius: "5px" }}>
14}
1516export default async function(req: Request): Promise<Response> {
17const url = new URL(req.url);
18if (url.pathname === "/") {
44}
4546function html(children: React.ReactNode) {
47return new Response(
48renderToString(
10});
1112export default async function(req: Request): Promise<Response> {
13const searchParams = new URL(req.url).searchParams;
14const to = searchParams.get("to");
helloooooooindex.ts3 matches
1314// Parse frontmatter from markdown content
15function parseFrontmatter(content: string) {
16const frontmatterRegex = /^---\n([\s\S]*?)\n---\n([\s\S]*)$/;
17const match = content.match(frontmatterRegex);
4344// Get all blog posts
45async function getAllPosts() {
46const files = await listFiles(import.meta.url);
47const postFiles = files.filter(file => file.startsWith('/posts/') && file.endsWith('.md'));
6566// Get a single blog post by slug
67async function getPost(slug: string) {
68try {
69const content = await readFile(`/posts/${slug}.md`, import.meta.url);
helloooooooindex.html6 matches
7273// Parse the current route
74function parseRoute() {
75const path = window.location.pathname;
76
109110// Show the list of posts
111async function showPostList() {
112const appElement = document.getElementById('app');
113
143144// Show a single post
145async function showPost(params) {
146const appElement = document.getElementById('app');
147appElement.innerHTML = `
201202// Add event listeners to internal links
203function addLinkEventListeners() {
204document.querySelectorAll('a').forEach(link => {
205const href = link.getAttribute('href');
216217// Navigate to a new route
218function navigateTo(path) {
219window.history.pushState({}, '', path);
220handleRouteChange();
222223// Handle route changes
224function handleRouteChange() {
225const { handler, params } = parseRoute();
226handler(params);
2import process from "node:process";
34export default async function server(request: Request): Promise<Response> {
5await sodium.ready;
6
sqliteExplorerApp2README.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
37