This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to convert a uv project into a Mac (Apple Silicon) .app binary | |
set -e | |
# Configuration - Set these for your app! | |
APP_NAME="your-app-name" | |
BUNDLE_NAME="${APP_NAME}.app" | |
BUNDLE_ID="com.your-company.${APP_NAME}" | |
PYTHON_VERSION="3.11" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openai import OpenAI | |
from pydantic import BaseModel, create_model | |
import inspect | |
import typing as t | |
client = OpenAI() | |
def vibe_code(model: str = "gpt-4o-mini"): | |
"""Decorator for the lazy""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PROJECT=$1 | |
uv init $PROJECT | |
cd $PROJECT | |
git init | |
touch .env | |
curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Python.gitignore | |
uv add marimo pydantic polars |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
title: 'Delete all Reading List', | |
process: async () => { | |
await chrome.readingList.query({}) | |
//.then(entries => Promise.all(entries.map(entry => chrome.readingList.removeEntry({url: entry.url})))); | |
.then(entries => alert(`Deleting ${entries.length} reading list entries...`)) | |
} | |
}, | |
{ | |
title: 'Import Pocket', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import json | |
import base64 | |
def speak(text: str, voice: str = "Joanna"): | |
polly_client = boto3.client('polly') | |
def synthensize_speech(speech_marks: bool): | |
response = polly_client.synthesize_speech( | |
VoiceId=voice, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: ./uv_github.sh <path_to_script> [args...] | |
ORG="pathikrit" | |
REPO="scripts" | |
if [ "$#" -lt 1 ]; then | |
echo "Usage: $0 <path_to_script> [args...]" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from dataclasses import dataclass | |
inf = float("inf") | |
# Married filing jointly standard deduction | |
# https://apps.irs.gov/app/vita/content/00/00_13_005.jsp?level=basic | |
standard_deduction = 30_000 | |
# NJ joint filing tax brackets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pv_export_long_history = '~/Downloads/pv_export_long_history.csv' | |
overrides = { | |
'RSBY': 'LCSIX', | |
'LCDS': 'DFSVX', | |
'MCDS': 'VOE', | |
'SCDS': 'SPYV', | |
'NIXT': 'SPY', | |
'EZBC': cash, | |
'SPYU': 'UPRO', | |
'MFUT': 'ASFYX', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import { Configuration as OpenAIConfig, OpenAIApi, ChatCompletionRequestMessageRoleEnum as Role } from 'openai' | |
const OPENAI_API_KEY = '?????' | |
const openai = new OpenAIApi(new OpenAIConfig({apiKey: OPENAI_API_KEY})) | |
const task = openai.createChatCompletion({ | |
model: 'gpt-3.5-turbo-0613', | |
max_tokens: 2048, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ChatCompletionRequestMessageRoleEnum as Role, OpenAIApi} from "openai"; | |
import {Configuration as OpenAIConfig} from "openai/dist/configuration.js"; | |
const OPENAI_API_KEY = 'XXXXXXXXXXXXXX' | |
const openai = new OpenAIApi(new OpenAIConfig({apiKey: OPENAI_API_KEY})) | |
const ask = (query) => { | |
return openai.createChatCompletion({ | |
model: 'gpt-3.5-turbo', | |
max_tokens: 2048, |
NewerOlder