Skip to content

Instantly share code, notes, and snippets.

View jishnurajendran's full-sized avatar
💭
casting spells

Jishnu jishnurajendran

💭
casting spells
View GitHub Profile
{
"basics": {
"name": "Jishnu Rajendran",
"label": "Quantum Physicist",
"picture": "https://avatars.githubusercontent.com/u/10544069?v=4",
"email": "[email protected]",
"phone": "918281245010",
"website": "https://jishnurajendran.github.io/",
"summary": " ",
"location": {
@jishnurajendran
jishnurajendran / waybar-emacs-orgmode-clocks.py
Last active October 27, 2024 13:39
A Python script that displays the current Org-mode clock status in Waybar (Sway/Wayland status bar). Shows the active task name and elapsed time, or "No active clock" when nothing is being tracked.
#!/usr/bin/env python3
import subprocess
import json
def get_current_clock():
try:
# Elisp to get current clock info with elapsed time
elisp_command = '''
(if (org-clock-is-active)
(format "%s [%s]"
@jishnurajendran
jishnurajendran / ollama_tool_setup.py
Last active August 7, 2024 00:41
Setup code for using tools with an Ollama model in a Langchain chat system.
from langchain_community.llms import Ollama
import requests
from langchain_core.tools import tool
from langchain_openai import ChatOpenAI
from langchain_core.output_parsers import JsonOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.tools import render_text_description
from langchain_core.runnables import RunnablePassthrough
from typing import Any, Dict, Optional, TypedDict