Skip to content

Instantly share code, notes, and snippets.

View scosman's full-sized avatar
⌨️

Steve Cosman scosman

⌨️
View GitHub Profile
@scosman
scosman / load.py
Last active December 10, 2024 16:58
Kiln Data Load Example
# pip install kiln-ai
import kiln_ai
import kiln_ai.datamodel
# Created a project and task via the UI and put its path here
task_path = "/Users/youruser/Kiln Projects/test project/tasks/632780983478 - Joke Generator/task.kiln"
task = kiln_ai.datamodel.Task.load_from_file(task_path)
# Add data to the task - loop over you dataset and run this for each item
item = kiln_ai.datamodel.TaskRun(
@scosman
scosman / Video.md
Last active November 20, 2024 19:45
Synthetic Data Generation with Kiln AI

This video is a walk-through of Kiln AI synthetic data generation. It's being used for a task to generate headlines for news articles.

Download the tool from: https://getkiln.ai

reddit.small.file.mp4
@scosman
scosman / 1 - Animating SVGs with Sonnet 3.5
Last active January 20, 2025 15:00
Sonnet 3.5 Fun - SVG Animation
I used sonnet 3.5 and Cursor to created a logo which animates on entry.
Input file: initial_logo.svg (below)
Prompt:
```
Let's add a start up animation to this SVG
Make it feel like feel like the logo starts broken, then fixes itself piece by piece. In a playful style like pixar.
```
{"label":"Coverage","message":"92%","schemaVersion":1,"color":"brightgreen"}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
helloworld
@scosman
scosman / dash.html
Created August 30, 2012 13:50
Kobo stats
<html>
<head>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(function()
{
$('#goBtn').click(function()
{
getStats();
setInterval(getStats, 300000); // 5 mins
@scosman
scosman / gist:2499922
Created April 26, 2012 14:22
Threaded delayed_job
# Threaded delayed_job. Useful for Heroku where each process/dyno costs money.
# run "rake jobs:threaded_work[4]" to start 4 worker threads
namespace :jobs do
desc "Start several delayed_job workers."
task :threaded_work, [:num_workers] => :environment do |t,args|
args.with_defaults(:num_workers => 1)
threads = []
workers = []
workersSemaphore = Mutex.new