Skip to content

Instantly share code, notes, and snippets.

@adamsmith
adamsmith / gist:2a22b08d3d4a11fb9fe06531aea4d67c
Created December 23, 2023 01:07
voice-memo transcript → organized markdown text, using LLMs
There are two prompts, that chain together. The first prompt does most of the work, and the second prompt organizes the sections. I found because of the nature of how LLMs write, I couldn't get just one prompt to never jump back and forth in topics.
Prompt 1, which takes as input a raw transcript and generates a structured-text version...
"""# Instructions
A transcript is provided below of a voice memo I recorded as a "note to self". please extract all the points made or thoughts described, and put them in bullet-point form. use nested bullet points to indicate structure, e.g. a top-level bullet for each topic area and sub-bullets underneath. use multi-level nesting as appropriate to organize the thinking logically. use markdown formatting with `*` instead of `-` for bullet points.
DO NOT OMIT ANY POINTS MADE. This is not a summarization task — your only goal is to structure the thoughts there so they are logically organized and easy to read. Be concise because the reader is busy, but again DO NOT omit any
@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active May 28, 2024 17:40
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
import autogen
config_list = [
{
'model': 'gpt-4',
'api_key': 'API_KEY'
}
]
llm_config={
@nikolaydyankov
nikolaydyankov / firebase.ts
Last active May 5, 2024 02:33
Svelte x Firebase writable store
// Firestore
export function writableFirestoreStore<T>() {
let unsubscribe: () => void = () => {}
let docRef: any
const store = writable<T | null>(null)
let storeSet = store.set
return {
subscribe: store.subscribe,

Async calls

<template>
<!-- 
When isLoading is true, the <div> is in the DOM, the <p> is not.
When isLoading is false, Vue will remove the <div> and add the <p> to the DOM,
at which point <MyComponent> will be created and passed the fetched data.
-->
@koenbok
koenbok / store.ts
Last active November 10, 2023 00:17
import * as React from "react";
/**
A hook to simply use state between components
Warning: this only works with function components (like any hook)
Usage:
// You can put this in an central file and import it too
const useStore = createStore({ count: 0 })
@isaumya
isaumya / http-curd-req-in-firebase-cloud-functions.js
Last active August 21, 2023 16:46
Making HTTP CRUD requests with Firebase Cloud Functions using node request-promise package
const functions = require('firebase-functions');
const cors = require('cors')({ origin: true });
const rp = require('request-promise');
exports.checkIP = functions.https.onRequest((req, res) => {
cors(req, res, () => {
if( req.method !== "GET" ) {
return res.status(401).json({
message: "Not allowed"
});
@romannurik
romannurik / tab-widget.tsx
Created August 23, 2018 15:51
A proof-of-concept Tab widget for Framer X
import { ControlType, PropertyControls } from "framer";
import * as React from "react";
interface TabWidgetProps {
selectedTab: number;
accentColor: string;
}
@JoelBesada
JoelBesada / sketch-loader.js
Created January 8, 2018 15:10
Webpack Sketch Loader
const JSZip = require('jszip')
const { parseBuffer } = require('bplist-parser')
const { isObject, each, find } = require('lodash')
const parseArchivedValue = value => {
return parseBuffer(new Buffer(value, 'base64'))
}
const parseArchivedString = obj => {
const { $objects } = parseArchivedValue(
@RayPS
RayPS / Framer-Simple-Grid.coffee
Last active March 20, 2021 13:41
Framer Simple Grid
column = 4
count = 19
gutter = 10
cellSize =
width: 100
height: 100
for i in [0...count]
offsetX = i % column
offsetY = Math.floor i / column