Skip to content

Instantly share code, notes, and snippets.

@neelabalan
neelabalan / aicli.py
Created March 2, 2024 16:04 — forked from samuelcolvin/aicli.py
OpenAI powered AI CLI in just a few lines of code - moved to https://github.com/samuelcolvin/aicli
#!/usr/bin/env python3
import os
from datetime import datetime, timezone
from pathlib import Path
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
import openai
from rich.console import Console
from rich.markdown import Markdown
@neelabalan
neelabalan / fast_speech_text_speech.py
Created February 24, 2024 08:00 — forked from thomwolf/fast_speech_text_speech.py
speech to text to speech
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio
"""
from openai import OpenAI
import time
@neelabalan
neelabalan / .gitconfig
Created January 15, 2024 07:52 — forked from architgarg/.gitconfig
Awesome git aliases - [For Medium Article]
[alias]
br = branch
st = status -s -b
lg = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative -20
ac = !git add -A && git commit -m
oops = !git add -A && git commit --amend --no-edit
unstash = stash pop
bd = branch -D
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neelabalan
neelabalan / normcore-llm.md
Created September 15, 2023 12:45 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@neelabalan
neelabalan / aproducer.py
Created July 23, 2023 07:58 — forked from dabeaz/aproducer.py
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@neelabalan
neelabalan / df_to_table.py
Created October 3, 2021 16:57 — forked from avi-perl/df_to_table.py
Convert a pandas.DataFrame object into a rich.Table object for stylized printing in Python.
from datetime import datetime
from typing import Optional
import pandas as pd
from rich import box
from rich.console import Console
from rich.table import Table
console = Console()
COUNTRY BEEF PIG POULTRY SHEEP TOTAL
ARG 40.41400058 8.24187459 36.4689953 1.174247185 86.29911766
AUS 22.8010372 20.25072536 42.00750521 7.423454044 92.48272181
BGD 0.885267859 5.14E-04 1.223173534 1.163676301 3.272631248
BRA 24.15640871 11.20721696 39.36312514 0.393513724 75.12026453
BRICS 4.289081407 15.79587836 10.29847417 1.654767905 32.03820184
CAN 17.37132968 15.74658647 34.15846671 0.81704465 68.09342751
CHL 14.96778476 17.51448686 30.93243359 0.411750266 63.82645548
CHN 3.817396071 31.56769795 11.61724318 2.965417779 49.96775498
COL 12.10121226 5.084564383 26.43592901 0.202352547 43.8240582