By day a coder, by night... also a coder
I joined KF, (as a dev) towards the end of 2016, and have been in Coach 2 (the greatest of a all feature-teams) for most of that time.
--- | |
# Page meta info, like heading, footer text and nav links | |
pageInfo: | |
title: Dashy | |
description: Welcome to your new dashboard! | |
navLinks: | |
- title: GitHub | |
path: https://github.com/Lissy93/dashy | |
- title: Documentation | |
path: https://dashy.to/docs |
/** | |
* A REST API for fetching the repsponse from | |
* a custom GPT assistant via the OpenAI API | |
* Deployed as a simple Cloudflare Worker | |
* Licensed under MIT (C) Alicia Sykes 2024 | |
*/ | |
(() => { | |
addEventListener("fetch", (event) => { | |
event.respondWith(handleRequest(event.request)); |
/** | |
* Fetch all comments on a given GitHub discussion | |
* A simple REST API, built for Cloudflare Workers | |
* Code licensed under MIT, (C) Alicia Sykes 2024 | |
*/ | |
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) |
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
const { pathname } = new URL(request.url); | |
const username = pathname.split('/')[1]; | |
if (!username) { | |
return new Response( |
/* Access control headers */ | |
const headers = { | |
'Access-Control-Allow-Origin': '*', | |
'Access-Control-Allow-Methods': 'GET, PUT, POST, OPTIONS', | |
'Access-Control-Allow-Headers': 'Content-Type', | |
'content-type': 'application/json;charset=UTF-8', | |
} | |
/* Listen for incoming requests, and call handler */ | |
addEventListener('fetch', event => { |
/** | |
* Cloudflare Worker script for displaying UK food products | |
* Fetches given item from Tesco.com using search endpoint | |
* Optionally resizes to specified dimensions | |
* Implements caches recently requested images | |
* Swaers a little bit when an error happens | |
*/ | |
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request, event)) |
export default { | |
async fetch(request, env) { | |
// Extract username and repo from the URL path | |
const url = new URL(request.url); | |
const pathSegments = url.pathname.split('/').filter(Boolean); | |
if (pathSegments.length !== 2) { | |
return new Response('URL must be in the format /{username}/{repo}', { status: 400 }); | |
} | |
const [username, repo] = pathSegments; |
[ | |
{ | |
"tla":"ABR", | |
"name":"Abbey Road" | |
}, | |
{ | |
"tla":"ACT", | |
"name":"Acton Town" | |
}, | |
{ |
// Include the sa module, needs installing first (npm install sentiment-analysis) | |
const sentimentAnalysis = require('sentiment-analysis'); | |
/** | |
* Gets the sentiment of a sentence | |
* using the sentiment-analysis module | |
* formats it, and prints to console | |
*/ | |
function displaySentiment(inputText, sentimentScore){ |