Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zitterbewegung
zitterbewegung / main_formatted.ts
Last active November 19, 2024 19:33
OpenAI Deno Vision Tutorial
import OpenAI from "npm:openai";
const openai = new OpenAI();
import { encode } from "https://deno.land/std@0.206.0/encoding/base64.ts";
async function main() {
// Ensure a file path argument is provided
if (Deno.args.length === 0) {
console.error("Usage: deno run --allow-read script.ts <image-file-path>");
Deno.exit(1);
}
#!/bin/bash
# Make the script executable
chmod +x install.sh
# Install Python dependencies
echo "Installing Python dependencies from requirements.txt..."
pip install -r requirements.txt
# Check and install Ghidra if needed
#!/bin/bash
sudo apt update
sudo apt install fuse libfuse3-dev libicu-dev bzip2 libbz2-dev cmake git libattr1-dev zlib1g-dev g++
sudo snap install cmake --classic
git clone https://github.com/sgan81/apfs-fuse.git
cd apfs-fuse
git submodule init
git submodule update
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
$(: !550 ) idle3.10
2023-04-24 14:24:52.856 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:24:53.243 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:32:36.062 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:32:36.076 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:32:36.168 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:32:36.179 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:32:36.184 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:32:36.195 Python[69630:507872] +[CATransaction synchronize] called within transaction
2023-04-24 14:32:36.201 Python[69630:507872] +[CATransaction synchronize] called within transaction
@zitterbewegung
zitterbewegung / gist:7c6f737bbfc41b09dbe714e9c078408d
Created March 24, 2023 23:01
Give me a recipe for Spanish american French toast pizza as it would be made in China
Spanish American French Toast Pizza with a Chinese Twist is an interesting fusion dish that combines elements from different cuisines. Here's a recipe to create this unique dish:
Ingredients:
6 slices of white bread or French baguette
3 eggs
1 cup milk
1/4 cup granulated sugar
1 teaspoon vanilla extract
1/2 teaspoon cinnamon
(venv) # Exit:0 2023-03-12 16:59:27 [r2q2@Reformer#[:~/opt/llama.cpp]
$(: !605 ) ./main -m ./models/65B/ggml-model-q4_0.bin -t 8 -n 128
main: seed = 1678658429
llama_model_load: loading model from './models/65B/ggml-model-q4_0.bin' - please wait ...
llama_model_load: n_vocab = 32000
llama_model_load: n_ctx = 512
llama_model_load: n_embd = 8192
llama_model_load: n_mult = 256
llama_model_load: n_head = 64
llama_model_load: n_layer = 80
@zitterbewegung
zitterbewegung / tweet2toot.py
Created November 22, 2022 18:51
Simple script to upload your twitter tweets from a twitter.js file to a mastodon server. NOTE: only upload around 600 at a time or contact the server owners or you can be banned.
#!/usr/bin/env python3
from mastodon import Mastodon
import re
import json
def main(api_base_url: str, client_id: str, secret: str,username: str, password:str, tweets= 'tweets.js': str, listed=True: bool)-> str:
Mastodon.create_app(
'pytooterapp',
api_base_url = api_base_url,
@zitterbewegung
zitterbewegung / Saturday.py
Last active February 11, 2023 20:48
Source code for vocal assistant.
#!/usr/bin/env python3
from transformers import pipeline
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import os
import time
import speech_recognition as sr
import pyttsx3