Skip to content

Instantly share code, notes, and snippets.

View Lissy93's full-sized avatar
:bowtie:
Stuck in an infinite loop

Alicia Sykes Lissy93

:bowtie:
Stuck in an infinite loop
View GitHub Profile
@Lissy93
Lissy93 / Example 1 - Getting Started - conf.yml
Last active May 11, 2024 09:56
Example Config Files for Dashy
---
# 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
@Lissy93
Lissy93 / open-ai-assistant.js
Last active February 29, 2024 10:26
A REST API for fetching the repsponse from a custom GPT assistant via the OpenAI API. Runs as a Cloudflare Worker.
/**
* 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));
@Lissy93
Lissy93 / github-discussion-comments.js
Created February 27, 2024 01:53
A simple REST API, to fetch all comments on a given GitHub discussion thread. Built as a Cloudflare Worker.
/**
* 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))
})
@Lissy93
Lissy93 / github-sponsors-api.js
Created February 27, 2024 01:17
A quick and easy Cloudflare Worker, for fetching all the GitHub Sponsors of a given user
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(
@Lissy93
Lissy93 / The-Alicia-Sykes-Hub-Blog.md
Last active February 27, 2024 01:06
While working for B&Q, we took turns in writing a 1-2 pager about ourselves for the company weekly newsletter, (hence the DIY references). This is my entry. Warning: Contains a lot of unfunny jokes,

Alicia Sykes: Kingfisher Hub Blog Entry

By day a coder, by night... also a coder

Me at Kingfisher

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.


Me and DIY

@Lissy93
Lissy93 / cloud-backup-restore-worker.js
Last active February 27, 2024 00:46
CloudFlare Worker for Dashy Backup and Restore
/* 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 => {
@Lissy93
Lissy93 / uk-food-images.js
Last active February 27, 2024 00:44
API for UK food product photos (via Cloudflare Workers)
/**
* 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))
@Lissy93
Lissy93 / repo-info-cf-worker.js
Created February 27, 2024 00:19
A quick 'n dirty Cloudflare Worker, for fetching pertinent about a given GitHub repository
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;
@Lissy93
Lissy93 / tfl-stations.json
Last active November 7, 2023 12:30
A list of all London Underground and DLR stations, along with their TLA codes 🚆
[
{
"tla":"ABR",
"name":"Abbey Road"
},
{
"tla":"ACT",
"name":"Acton Town"
},
{
@Lissy93
Lissy93 / sentiment-analysis-example.js
Created August 10, 2017 09:23
A quick example of calculating percentage positive or negativeness of a given sentence, using the npm sentiment-analysis module
// 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){