Skip to content

Instantly share code, notes, and snippets.

@hiskiapp
hiskiapp / openai-proxy.js
Created July 13, 2023 00:03
OpenAI Proxy - Cloudflare Workers
addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const url = new URL(request.url);
const fetchAPI = request.url.replace(url.host, 'api.openai.com');
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
@hiskiapp
hiskiapp / fruition.js
Created January 6, 2023 05:57
Fruition
/* CONFIGURATION STARTS HERE */
/* Step 1: enter your domain name */
const MY_DOMAIN = 'hiskia.app';
/*
* Step 2: enter your URL slug to page ID mapping
* The key on the left is the slug (without the slash)
* The value on the right is the Notion page ID
*/
@hiskiapp
hiskiapp / FileService.php
Created November 26, 2020 07:02
File Service Layer for Laravel
<?php
namespace Services;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\Facades\Image;
use File;
class FileService
{