Skip to content

Instantly share code, notes, and snippets.

View happylinks's full-sized avatar

Michiel Westerbeek happylinks

View GitHub Profile
@dan-palmer
dan-palmer / prompt.json
Created February 2, 2024 13:49
Arc Search Browse for Me Prompt
{
"messages": [
{
"content": "You are an advanced, reliable, candid AI system that takes user search queries, converts them into questions, and answers them, using specific facts and details sourced from webpages to prove your answer. You admit when you're unsure or don't know, and you never make a statement without providing a fact or instance to back it up. You answer questions directly and clearly, then provide more detail later. You follow the JSON schema exactly.",
"role": "system"
},
{
"content": "# CONTEXT\nCurrent date: #{DATE_TIME}.\n\nHere are result from a web search for '#{QUERY}':\nBEGIN WEB PAGE #{HOST_1} #{MARKDOWN_1}END WEB PAGE\nBEGIN WEB PAGE #{HOST_2} #{MARKDOWN_2}END WEB PAGE\nBEGIN WEB PAGE #{HOST_3} #{MARKDOWN_3}END WEB PAGE\nBEGIN WEB PAGE #{HOST_4} #{MARKDOWN_4}END WEB PAGE\nBEGIN WEB PAGE #{HOST_5} #{MARKDOWN_5}END WEB PAGE\nBEGIN WEB PAGE #{HOST_6} #{MARKDOWN_6}END WEB PAGE",
"role": "system"
},
import { EventEmitter } from "eventemitter3";
import type { MP4ArrayBuffer, MP4File, MP4Info, MP4Sample } from "mp4box";
import * as MP4Box from "mp4box";
import type { MediaFile } from "../../models.js";
import type { IDisposable } from "../abstract/hooks.js";
import type {
VideoMetadata,
} from "../abstract/pipeline.js";
import type { MediaFileObjectUrlProvider } from "../utils/ObjectUrlProvider.js";
// This is a proper alternative to
// https://github.com/BuckleScript/bucklescript/blob/b9508105b1a35537bdea9a1fabd10f6c65f776b4/jscomp/bsb/templates/react-hooks/src/FetchedDogPictures/FetchedDogPictures.re#L14
// The one in that file uses Promise, but that's *wrong*.
// We only used promise as a demo of its API. We'll remove it soon.
// As you can see below, the pure XMLHttpRequest code is just as clean,
// less mysterious for all, more performant, extensible, and actually correct.
// Ignore these externals for now. They're just for illustration
// purposes. I just copy pasted the Js code from
@tetsu-koba
tetsu-koba / 00_rust_cairo
Last active January 26, 2024 13:16
2D graphics animation tool using cairo rust binding and ffmpeg
2D graphics animation tool using cairo rust binding and ffmpeg
@busypeoples
busypeoples / Graph.re
Last active November 18, 2019 21:59
Data Structures in ReasonML: #8 Graph
/* Graph */
exception Not_found;
type nodes = list(int);
type edges = list((int, int));
type graph =
| Empty
| Graph(nodes, edges);
'use strict';
/*globals ebml */
if ( !window.ebml ) window.ebml = {};
ebml.EbmlDecoder = function EbmlDecoder( options ) {
var schema = {
"80": {
@dslaw
dslaw / .skhdrc
Last active October 22, 2021 14:47
Setup for macOS
# open terminal
cmd - return : osascript -e 'tell application "iTerm" to create window with default profile'
# enter fullscreen mode for the focused container
# cmd + f clobbers text search in firefox.
shift + cmd - f : yabai -m window --toggle zoom-fullscreen
# kill focused window
shift + cmd - q : yabai -m window --close
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@kgoggin
kgoggin / RecursiveGQLTypes.re
Created April 10, 2018 13:19
This gist shows how you could go about defining ReasonML types based on a GraphQL schema that reference each other, as well as a recursive decoder function used to parse a JSON response into the correct type.
/* Use Reason's ability to define recursive types with the `and` keyword */
type movie = {
id: option(string),
name: option(string),
rating: option(Js.null(string)),
runTime: option(Js.null(int)),
actors: option(list(actor)),
}
and actor = {
id: option(string),
@jdeisenberg
jdeisenberg / QueryString.re
Last active August 22, 2019 04:25
Parse a query string in ReasonML
/*
* Define a type that can be either a single string or a list of strings
*/
type queryItem =
| Single(string)
| Multiple(list(string));
/*
* Make a string “safe” by