Skip to content

Instantly share code, notes, and snippets.

View enjalot's full-sized avatar

Ian Johnson enjalot

View GitHub Profile
@enjalot
enjalot / embedding.py
Created June 5, 2024 22:00
trying to parallelize embedding on modal
import os
import json
import time
import asyncio
import subprocess
from modal import App, Image, Secret, Volume, build, enter, exit, gpu, method
# We first set out configuration variables for our script.
## Embedding Containers Configuration
@enjalot
enjalot / clip_server.py
Created February 21, 2023 17:31
get SD friendly CLIP embeddings for 1.x and 2.x
print("importing")
from flask import Flask, request
from flask_cors import CORS
import json
import torch
import torch.nn as nn
import pandas as pd
import numpy as np
@enjalot
enjalot / README.md
Created May 19, 2022 17:40
node script to convert csv to parquet
node duckdb.cjs mydata.csv

will create the file mydata.parquet with GZIP compression.

@enjalot
enjalot / .block
Last active February 17, 2021 04:52
d3 anniversary animation big
license: mit
@enjalot
enjalot / .block
Last active February 17, 2021 04:51
d3 anniversary animation
license: mit
@enjalot
enjalot / clone.js
Created February 8, 2021 17:53
a set of scripts to pull the git history from the d3 git repositories
let fs = require("fs")
let {exec} = require("child_process")
// read package.json
let packageText = fs.readFileSync("./d3/package.json").toString()
let packageJson = JSON.parse(packageText)
// loop through dependencies
let depends = Object.keys(packageJson.dependencies)
console.log("dependencies", depends)
// clone each repo
@enjalot
enjalot / .block
Last active September 14, 2020 02:58
Coding With Fire: enjalot Deadline Timer
license: mit
@enjalot
enjalot / .block
Created September 14, 2020 01:42
Coding With Fire: Deadline Timer
license: mit
@enjalot
enjalot / .gitignore
Last active November 16, 2020 03:55 — forked from ejfox/package.json
package-lock.json
node_modules
secret
output*
bubbles0*
*.mp4
*.png
*.json
@enjalot
enjalot / alex4.js
Created August 4, 2020 23:54 — forked from ejfox/alex4.js
const { load } = require("@alex.garcia/observable-prerender");
const puppeteer = require("puppeteer");
async function main() {
let mapWidth = 1920
let mapHeight = 1080
// let startDate = "20200301"
let startDate = "20200420"