Skip to content

Instantly share code, notes, and snippets.

@neubig
neubig / dispatch_openai_requests.py
Last active February 19, 2024 17:55
A simple script to get results from the OpenAI Asynchronous API
# NOTE:
# You can find an updated, more robust and feature-rich implementation
# in Zeno Build
# - Zeno Build: https://github.com/zeno-ml/zeno-build/
# - Implementation: https://github.com/zeno-ml/zeno-build/blob/main/zeno_build/models/providers/openai_utils.py
import openai
import asyncio
from typing import Any
@bradtraversy
bradtraversy / python_heroku.MD
Created August 16, 2019 16:38
Python & Postgres Heroku Deployment

Python Heroku Deployment

Steps to create a postgres database and deply a Python app to Heroku

Install guinicorn locally

pipenv install gunicorn
or
pip install gunicorn
@amatellanes
amatellanes / celery.sh
Last active April 19, 2024 11:31
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@dompascal
dompascal / css-structure-with-media-queries.css
Created November 23, 2013 10:56
CSS - Structure with Media Queries
/* fonts */
/* ------------------------------------------------------------------------- */
/* reset */
/* ------------------------------------------------------------------------- */
@import url('css/reset.css');
@import url('css/normalize.min.css');