Skip to content

Instantly share code, notes, and snippets.

View ishan-marikar's full-sized avatar
📚
Learning Data Visualisation and Data Science

Ishan Marikar ishan-marikar

📚
Learning Data Visualisation and Data Science
View GitHub Profile
@ishan-marikar
ishan-marikar / ollama_dspy.py
Created April 4, 2024 11:07 — forked from jrknox1977/ollama_dspy.py
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.
@ishan-marikar
ishan-marikar / genRegexFromJSON.ts
Created March 25, 2024 06:26 — forked from hrishioa/genRegexFromJSON.ts
Generate Regexes for ReLLM from Typescript types
// Meant to work with the code in https://github.com/hrishioa/socrate, specifically the functions in the `gpt/base.ts`.
// Created by Hrishi Olickel (@hrishioa) Sub 7 May
import { Messages, askChatGPT } from '../base';
async function generateRegexFromTypeSpec(typeSpec: string): Promise<string | null> {
//prettier-ignore
const prompts = {
systemPrompt: () => `You are a Typescript type to Regex converter that can only output valid Regexes.`,
specPrompt: (spec: string) => `Convert the following TYPESCRIPT_TYPE into a valid Regex that matches the type.
@ishan-marikar
ishan-marikar / load_and_process_open_source_licenses.ts
Created March 25, 2024 06:25 — forked from hrishioa/load_and_process_open_source_licenses.ts
Simple Typescript file demonstrating chunked, chained LLM calls to process large amounts of text.
// Requires the gpt library from https://github.com/hrishioa/socrate and the progress bar library.
// Created by Hrishi Olickel (hrishioa@gmail.com) (@hrishioa). Reach out if you have trouble running this.
import { ThunkQueue } from '../../utils/simplethrottler';
import {
AcceptedModels,
Messages,
askChatGPT,
getMessagesTokenCount,
getProperJSONFromGPT,
@ishan-marikar
ishan-marikar / PostgreSQL-EXTENSIONs.md
Created March 22, 2024 20:44 — forked from joelonsql/PostgreSQL-EXTENSIONs.md
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

# Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging formatters for %(asctime)s
#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
@ishan-marikar
ishan-marikar / README.md
Created February 23, 2024 16:36 — forked from gjreasoner/README.md
Expand Ubuntu 20 Proxmox Disk
# Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click "Resize disk" button

# Confirm increase in disk space (1TB in my case)
$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0    1T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0    1T  0 part
@ishan-marikar
ishan-marikar / magisk_ramdisk_patch_avd.sh
Created October 28, 2023 10:34 — forked from tothi/magisk_ramdisk_patch_avd.sh
Apply Magisk patches on AVD (Android Emulator) RAMDISK images for running Magisk (root) on Android Emulators
#!/bin/bash
#
# patch ramdisk.img (for installing Magisk on x64 Android emulator)
#
# x86_64 on Android 12 (API Level 32) is supported/tested currently
#
# install AVD:
#
# sudo sdkmanager 'system-images;android-32;google_apis_playstore;x86_64'
@ishan-marikar
ishan-marikar / RUST.MD
Created July 31, 2023 10:31 — forked from Mefistophell/RUST.MD
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@ishan-marikar
ishan-marikar / dev.conf
Created January 3, 2022 06:38 — forked from fnando/dev.conf
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;