Skip to content

Instantly share code, notes, and snippets.

View nasir733's full-sized avatar
:octocat:
Working from home

Nasir Iqbal nasir733

:octocat:
Working from home
View GitHub Profile
from celery import shared_task
import os
from pprint import pprint
from dotenv import load_dotenv
import logging, verboselogs
from datetime import datetime, timedelta
import json
from django.conf import settings
from langchain_community.llms import OpenAI as LLMOpenAI
from langchain.prompts import PromptTemplate
@nasir733
nasir733 / blurhashDataURL.ts
Created January 26, 2023 05:59 — forked from gxvxc/blurhashDataURL.ts
Convert blurhash to a base64 DataURL string (no canvas or node-canvas)
import { decode } from "blurhash"
const cache: Record<string, string> = {}
export function blurHashToDataURL(hash: string | undefined): string | undefined {
if (!hash) return undefined
const cachedBlurDataURL = cache[hash]
if(cachedBlurDataURL) {