Skip to content

Instantly share code, notes, and snippets.

@deepfates
deepfates / convert_oai_to_sharegpt.py
Created November 17, 2024 20:26
Convert a fine-tuning dataset from OpenAI format to ShareGPT format
import json
import argparse
def convert_oai_to_sharegpt(input_file: str, output_file: str):
with open(input_file, 'r') as infile, open(output_file, 'w') as outfile:
for line in infile:
conversation = json.loads(line)
# Skip system messages
for message in conversation["messages"]:
if message.get("role") == "system":
@deepfates
deepfates / convert_archive.py
Created November 17, 2024 19:33
Convert your twitter archive into a training dataset and markdown files
import argparse
import json
import logging
import os
import re
import shutil
from concurrent.futures import ProcessPoolExecutor, as_completed
from dataclasses import dataclass
from datetime import datetime
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple
@veekaybee
veekaybee / normcore-llm.md
Last active May 6, 2025 20:15
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
@karlkranich
karlkranich / multisheet-duplicate-finder.js
Last active May 30, 2021 13:52
Find duplicates across Google Sheets
/** Multisheet Duplicate Finder **
To use, paste this code into a Google Spreadsheets Apps Script (Tools - Script editor)
Loops through all of the sheets in the current spreadsheet.
Identifies duplicates in the chosen column.
Skips the chosen number of header rows.
Creates and alert box listing the duplicates, and colors the duplicate cells red.
The directive below limits the script to only be able to access this spreadsheet.
* @OnlyCurrentDoc
*/
@klamouri
klamouri / README.md
Last active February 22, 2024 02:04
Iterm2 Auto Dark/Light mode

Most of it is taken from this gist. I just tweaked the script to check the right theme at startup in case the theme change occured when iTerm2 was closed.

Make sure the theme is the same as the themes you have installed (Preferences > Profiles > Colors > Color Presets...). I personally use Solarized Dark and Solarized Light

From someone on the linked gist:

First-time installation steps for me:

  1. Download the script from GitHub by right-clicking on Raw button and save as...
  2. copy the script to $HOME/Library/Application Support/iTerm2/Scripts/AutoLaunch
  3. create AutoLaunch folder if it does not exist
  4. go to iTerm2 > Scripts > AutoLaunch
// Pre Placement Revision Guide!
// All the very best for placements!
#include <bits/stdc++.h>
using namespace std;
/*
THIS RESOURCE WAS MADE FOR END MIN REVISION OF SOME INBUILT DS AND CONTAINERS THAT C++ STL
HAS TO OFFER.
IF THERE IS ANY BUG OR ERROR PLEASE LET ME KNOW!
@aashutoshrathi
aashutoshrathi / clearClutter.js
Created July 9, 2020 14:10
Clears the new x/x repository cards from GitHub Feed
x = document.querySelectorAll('div.f4.lh-condensed.text-bold.text-gray-dark');
for(let i=0; i<x.length; i++) {
const [a, b] = x[i].children[0].innerText.split('/');
if(a === b)
x[i].parentElement.parentElement.remove();
}
@L-Ramos
L-Ramos / shap_cross_validation.ipynb
Last active February 14, 2022 23:35
shap_cross_validation.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.