Skip to content

Instantly share code, notes, and snippets.

View swyxio's full-sized avatar
🎯
Focusing

swyx.io swyxio

🎯
Focusing
View GitHub Profile
@swyxio
swyxio / devin-temporal-workflow.go
Created April 16, 2024 18:35
temporal workflow bootstrapped from a single instruction "browse the temporal.io docs to write a simple Golang workflow for sending an email at 9am PT every day, skipping a day when a signal has been sent to skip the day" on the livestream https://twitter.com/swyx/status/1778641185193730488
package main
import (
"context"
"log"
"time"
"go.temporal.io/sdk/client"
"go.temporal.io/sdk/worker"
"go.temporal.io/sdk/workflow"
@swyxio
swyxio / gist:e8d2f66cffedac32ed8a15a35d36fa4b
Last active April 12, 2024 06:39
swe agent vs opendevin
Parsing command file: config/commands/defaults.sh
Parsing command file: config/commands/search.sh
Parsing command file: config/commands/edit_linting.sh
Parsing command file: config/commands/_split_string.py
Parsing command file: config/commands/defaults.sh
Parsing command file: config/commands/search.sh
Parsing command file: config/commands/edit_linting.sh
Parsing command file: config/commands/_split_string.py
INFO 📙 Arguments: actions:
open_pr: true
@swyxio
swyxio / DAY_1_devin_train_gpt2.c
Last active April 16, 2024 19:52
Devin-coded version of @karpathy's train_gpt.py ported to C, per his challenge https://x.com/swyx/status/1777496494448488541 this is where Devin stopped about 6 hours in, however it is not complete and I can prompt it to keep going.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// Constants for model dimensions, learning rate, etc.
## Guild: [Nous Research AI](https://discord.com/channels/1053877538025386074)
### Nous Research AI Guild Summary
- Discussion on massive image data hosting: Members of the channel explore different options like Amazon S3, local storage, and Hugging Face for hosting TBs of image data from midjourney. The group suggests using **Hugging Face** due to its free storage and high file size limit but acknowledges the risk of a single point of failure. A relevant [YouTube video](https://youtu.be/gqw46IcPxfY) and a [discussion post from Hugging Face](https://discuss.huggingface.co/t/is-there-a-size-limit-for-dataset-hosting/14861/3) were shared for more insights.
- An engaging dialogue took place concerning AI and music transformation, with reference to Google's project, followed by deep disappointment in AI cutting-edge technology not being open source. AI's potential in game playing, especially at pixel-level was also touched upon through sharing an [old Python project](https://www.youtube.com/watch?v=eQC1JGMIx
@swyxio
swyxio / scrape.js
Created November 1, 2022 06:10
how to scrape folder start dates from git
const { exec } = require('child_process');
// exec(`
// git log --reverse -- /Users/swyx/Desktop/Work/airbyte/airbyte-integrations/connectors/destination-amazon-sqs | awk 'NR>1 {print last} {last=$0}; /^commit/ && ++c==2{exit}'
// `, (err, stdout, stderr) => {
// if (err) {
// // node couldn't execute the command
// return;
@swyxio
swyxio / gist:135136c1217b038e4b897415845e8150
Last active October 20, 2022 18:01
prompts used for Airbyte Data Nets article https://airbyte.com/blog/data-nets
1. Introduction
2. What are Data Nets?
3. Data Nets vs. Data Mesh
4. Data Nets vs. Data Contract
5. When do you need a Data Net?
@swyxio
swyxio / openaiscript.py
Last active October 18, 2022 05:05
web scraping + gpt3. given a company name we scrape google for relevant urls and then scrape those urls for info. persisting each step in case google blocks, so we can switch IP and carry on. once we accumulated our corpus, feed into openai to generate company categories and descriptions.
# https://beta.openai.com/docs/libraries
import os
import openai
import yaml
# Load your API key from an environment variable or secret management service
openai.api_key = os.getenv("OPENAI_API_KEY")
@swyxio
swyxio / contribs.js
Last active September 16, 2022 22:26
airbyte contiburs
[
{
"login": "cgardens",
"id": 9092207,
"node_id": "MDQ6VXNlcjkwOTIyMDc=",
"avatar_url": "https://avatars.githubusercontent.com/u/9092207?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cgardens",
"html_url": "https://github.com/cgardens",
"followers_url": "https://api.github.com/users/cgardens/followers",
@swyxio
swyxio / overcast.opml
Created August 12, 2022 16:01
my Overcast podcast feed - Aug 2022
<?xml version="1.0"?>
<opml version="1.0"><head><title>Overcast Podcast Subscriptions</title></head><body>
<outline type="rss"
text="Editor's Picks from The Economist" title="Editor's Picks from The Economist"
xmlUrl="https://rss.acast.com/theeconomisteditorspicks"
htmlUrl="http://www.economist.com/"/>
<outline type="rss"
text="The History of English Podcast" title="The History of English Podcast"
xmlUrl="https://historyofenglishpodcast.com/feed/podcast/"
htmlUrl="https://historyofenglishpodcast.com/"/>
@swyxio
swyxio / 01 - sample workflow.ts
Last active February 15, 2022 17:55
sample Temporal workflow - see https://youtu.be/2pxZgGhT-Xo for context and full video!
import * as wf from '@temporalio/workflow';
import differenceInMilliseconds from 'date-fns/differenceInMilliseconds';
import type * as activities from './activities';
import { sub } from 'date-fns'
const {
doMaintenance,
notifySubscribers
} = wf.proxyActivities<typeof activities>({
// remember to adjust timeouts!