Skip to content

Instantly share code, notes, and snippets.

@frederickk
frederickk / easing.js
Last active July 24, 2020 07:40 — forked from gre/easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
var EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
@frederickk
frederickk / summariser-ollama-openai.py
Created March 1, 2025 21:17 — forked from boxabirds/summariser-ollama-openai.go
Use Ollama to run an AI summariser on your machine for free
import argparse
import os
import time
import sys
from openai import OpenAI
def chunk_text(text, chunk_size=400, overlap=100):
"""Split text into overlapping chunks of roughly chunk_size characters."""
if len(text) <= chunk_size:
return [text]