Skip to content

Instantly share code, notes, and snippets.

View codegod100's full-sized avatar
🌍
Hack the planet

nandi codegod100

🌍
Hack the planet
View GitHub Profile
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/fedora/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
@codegod100
codegod100 / monad.ts
Created February 15, 2025 00:56
monad
// Define the Monad structure using `unit` and `bind`
type Monad<M extends { __type: any }> = {
unit: <A>(value: A) => M & { __type: A };
bind: <A, B>(ma: M & { __type: A }, f: (a: A) => M & { __type: B }) => M & { __type: B };
};
// Example: Maybe monad implementation
type Just<A> = { __type: A; tag: 'Just'; value: A };
type Nothing = { __type: any; tag: 'Nothing' };
type Maybe<A> = Just<A> | Nothing;
@codegod100
codegod100 / main.rs
Created October 7, 2024 17:34
mario generated from ai
use tracing::debug;
fn main() {
tracing_subscriber::fmt::init();
let spec = hound::WavSpec {
channels: 1,
sample_rate: 44100,
bits_per_sample: 16,
sample_format: hound::SampleFormat::Int,
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@codegod100
codegod100 / rag.py
Created October 26, 2023 06:31
document look using agent
from langchain.document_loaders import TextLoader
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import FAISS
from langchain.document_loaders import UnstructuredMarkdownLoader
from langchain.document_loaders import DirectoryLoader
from langchain.chat_models.fireworks import ChatFireworks
from langchain.agents.agent_toolkits import (
create_vectorstore_agent,
@codegod100
codegod100 / rag.py
Created October 26, 2023 06:30
embedding agent for agora
β€Žβ€Žβ€‹
- target: garden/vera-journal
url: https://github.com/codegod100/daily.git
format: foam
- target: garden/neil
url: https://gitlab.com/ngm/commonplace-agora.git
edit: https://gitlab.com/ngm/commonplace-agora/-/edit/master/{path}
web: https://commonplace.doubleloop.net/{slug}
format: ox-agora
- target: garden/flancian
url: https://github.com/flancian/garden.git
use git2::{RemoteCallbacks, Repository};
use simple_logger::SimpleLogger;
use std::{env, path::Path};
struct User {
name: String,
remote: String,
}
fn main() {
#![deny(warnings)]
use std::{process, thread};
fn main() {
let mut threads = vec![];
let str = std::fs::read_to_string("/proc/sys/kernel/threads-max").unwrap();
let maxt: i32 = str.trim().parse().unwrap();
let mut count = 0;
for x in 1..maxt {
let b = thread::Builder::new();
let r = b.spawn(move || {
use simple_logger::SimpleLogger;
use serde::{Deserialize,Serialize};
use serde_json::{ json};
#[derive(Debug)]
enum Message {
Ping,
Command { name: String, arg: String },
}