Skip to content

Instantly share code, notes, and snippets.

View ShaunSpringer's full-sized avatar

Shaun Springer ShaunSpringer

  • Ease Capital
  • Aspen, CO
  • 04:31 (UTC -06:00)
View GitHub Profile
@mkcode
mkcode / route.ts
Last active June 28, 2024 21:52
How to setup Next App Router + Clerk + TRPC
// TRPC API endpoint
// src/app/api/trpc/[trpc]/route.ts
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import { type NextRequest } from "next/server";
import { env } from "~/env";
import { appRouter } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/trpc";
import { getAuth } from "@clerk/nextjs/server";
@Hellisotherpeople
Hellisotherpeople / blog.md
Last active June 20, 2024 12:29
You probably don't know how to do Prompt Engineering, let me educate you.

You probably don't know how to do Prompt Engineering

(This post could also be titled "Features missing from most LLM front-ends that should exist")

Apologies for the snarky title, but there has been a huge amount of discussion around so called "Prompt Engineering" these past few months on all kinds of platforms. Much of it is coming from individuals who are peddling around an awful lot of "Prompting" and very little "Engineering".

Most of these discussions are little more than users finding that writing more creative and complicated prompts can help them solve a task that a more simple prompt was unable to help with. I claim this is not Prompt Engineering. This is not to say that crafting good prompts is not a difficult task, but it does not involve doing any kind of sophisticated modifications to general "template" of a prompt.

Others, who I think do deserve to call themselves "Prompt Engineers" (and an awful lot more than that), have been writing about and utilizing the rich new eco-system

@rain-1
rain-1 / LLM.md
Last active July 3, 2024 15:04
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@lawrencecchen
lawrencecchen / tinysync.ts
Created July 19, 2022 08:26
A Typescript first queue/job/schedule engine.
// i like trpc. i like autocomplete. i like vercel/serverless.
// netlify acquired quirrel.
// theo would shill for a type safe option.
// there's a gap for a type-safe scheduling/cron/queuing/realtime and i want to fill it.
// also, quirrel has weird syntax for
// framing: typescript-first bindings for what you would typically use redis for
const appRouter = createRouter();
@KATT
KATT / 0-README.md
Last active August 5, 2022 20:48
`useRouterQuery()` hook to get query params on first render
@Purpzie
Purpzie / update-lockfile.yml
Last active May 6, 2023 13:22
Action to update pnpm-lock.yaml when Dependabot opens a PR. Be warned that this may cause lots of merge conflicts.
# https://github.com/dependabot/dependabot-core/issues/1736
name: Dependabot
on: pull_request_target
permissions: read-all
jobs:
update-lockfile:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
permissions:
pull-requests: write
@tannerlinsley
tannerlinsley / README.md
Last active April 12, 2024 17:04
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@mikehwagz
mikehwagz / _app.js
Created August 22, 2020 13:14
Page transitions with GSAP in Next.js
import { SwitchTransition, Transition } from 'react-transition-group'
import gsap from 'gsap'
function MyApp({ Component, pageProps, router }) {
return (
<SwitchTransition>
<Transition
key={router.pathname}
timeout={500}
in={true}
@michal-wrzosek
michal-wrzosek / composeHOCsTypescript.tsx
Last active August 5, 2022 15:45
Typing compose with multiple React HOCs (Typescript, HOC, React)
import { compose } from 'ramda';
export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type ABCProps = {
a: string;
b: string;
c: string;
};
@YBogomolov
YBogomolov / fsm_cb.ts
Created March 24, 2019 09:14
FSM using Circuit Breaker
import AbortController from 'abort-controller';
import { circuitBreaker, defaultBreakerOptions } from 'circuit-breaker-monad/lib';
import { BreakerClosed, BreakerOpen, BreakerState } from 'circuit-breaker-monad/lib/types';
import { Either, left } from 'fp-ts/lib/Either';
import { Lazy } from 'fp-ts/lib/function';
import { IORef } from 'fp-ts/lib/IORef';
import fetch from 'node-fetch';
const fetcher = circuitBreaker<User[]>().run(defaultBreakerOptions);