Skip to content

Instantly share code, notes, and snippets.

View svngoku's full-sized avatar
🏠
Working from home

svngoku

🏠
Working from home
  • Paris, France
View GitHub Profile
@davidberenstein1957
davidberenstein1957 / vector_search_hub_datasets.py
Last active February 28, 2025 11:10
vector search on the Hugging Face Hub
# /// script
# requires-python = ">=3.11,<3.12"
# dependencies = [
# "duckdb", sentence-transformers, huggingface_hub
# ]
# ///
from sentence_transformers import SentenceTransformer
import duckdb
from huggingface_hub import get_token
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active October 4, 2026 02:25
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
import os
from llama_parse import LlamaParse # pip install llama-parse
from llama_index.core import SimpleDirectoryReader # pip install llama-index
source_directory = r'\data'
target_directory = r'\tables'
parser = LlamaParse(
api_key="...", # can also be set in your env as LLAMA_CLOUD_API_KEY
result_type="markdown", # "markdown" and "text" are available
@mlabonne
mlabonne / finetune_llama2.py
Last active July 12, 2026 23:03
Easy Llama 2 fine-tuning script (📝 Article: https://tinyurl.com/finetunellama2)
# Based on younesbelkada/finetune_llama_v2.py
# Install the following libraries:
# pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy
from dataclasses import dataclass, field
from typing import Optional
import torch
from datasets import load_dataset
from transformers import (
@phortuin
phortuin / postgres.md
Last active May 14, 2026 05:23
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

@itsabdessalam
itsabdessalam / copy.js
Last active September 29, 2020 00:09
Copy to clipboard
// if code snippet is inside input or textarea tags
function copy() {
var codeSnippet = document.querySelector("#code-snippet");
codeSnippet.select();
document.execCommand("copy");
}
document.querySelector("#copy").addEventListener("click", copy);
// if code snippet is inside pre or code tags
function copy() {
@tjpeter
tjpeter / SQL Movie - Rating Query Exercises Extras.sql
Last active January 23, 2023 01:56
StanfordOnline - Databases: Relational Databases and SQL
--- 1. Find the names of all reviewers who rated Gone with the Wind.
SELECT DISTINCT name
FROM Movie
JOIN rating USING(mID)
JOIN reviewer USING(rID)
WHERE title = "Gone with the Wind";
--- 2. For any rating where the reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.
---
title: "Rmarkdown"
author: "me"
date: "7/17/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
@fernandoaleman
fernandoaleman / how-to-clean-up-ubuntu.md
Last active December 22, 2025 08:19
How to clean up Ubuntu

How To Clean Up Ubuntu

Some simple ways to free up space on Ubuntu

Remove Unnecessary Packages and Dependencies

apt-get autoremove
@neodigm
neodigm / music-ad-blocker.js
Last active October 26, 2023 22:30
Automatically mute the Music player when Ads are playing and unmute when they are done (in Chrome).
let spotADify = ( (_d, _q, _t) => {
let eS = _d.querySelector( _q ), bS = true;
if( eS ){ // 🏖️ Play your Jams! 🎶
bS = ( eS.getAttribute("aria-label") == "Mute" );
setInterval( () => {spotADify.tick();}, _t);
return {
"tick": () => {
if((_d.title.indexOf("Adve") != -1) || (_d.title.indexOf("Spoti") != -1)){
if( bS ){ eS.click(); bS=!true; }
}else{