Skip to content

Instantly share code, notes, and snippets.

View ianschmitz's full-sized avatar
:octocat:

Ian Schmitz ianschmitz

:octocat:
  • Victoria, BC, Canada
View GitHub Profile
@ianschmitz
ianschmitz / worker.ts
Created December 14, 2023 21:19
Cloudflare Workers AI proxy example
// This is an example endpoint built for use on Cloudflare Workers using the Hono app.
// This example uses Cloudflare AI to run their hosted llama model,
// but could easily be tweaked to suit consuming the OpenAI SDK directly.
// You could also just use the `fetch` API directly and skip using the SDK as well,
// you'd just have to set the appropriate HTTP headers and query params (API key, etc)
// See second example for a simpler case.
// References:
// - https://developers.cloudflare.com/workers/runtime-apis/streams/
// - https://developers.cloudflare.com/workers/platform/pricing/
// - For Cloudflare AI usage within worker: https://developers.cloudflare.com/workers-ai/platform/bindings/
@ianschmitz
ianschmitz / .eslintrc.js
Created July 7, 2022 04:22
Current ESLint config
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
@ianschmitz
ianschmitz / ExtendedSlider.cs
Last active November 9, 2016 18:07
Xamarin Slider Up/Down events
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace NativeApp
{
public class ExtendedSlider : Slider