Skip to content

Instantly share code, notes, and snippets.

View lukaszhanusik's full-sized avatar
✨👁️🖤👁️✨ ⚡️

Lukasz Hanusik lukaszhanusik

✨👁️🖤👁️✨ ⚡️
View GitHub Profile
@Bilbottom
Bilbottom / customers-and-loans.sql
Created May 9, 2024 06:05
Mermaid + DuckDB for generating customer hierarchy diagrams
/*
Mermaid + DuckDB for generating customer hierarchy diagrams
DuckDB version: 0.10.2
Bill Wallis, 2024-05-09
*/
select version();
@Bilbottom
Bilbottom / er-diagram.mermaid
Last active July 1, 2024 11:20
Mermaid + DuckDB for generating entity-relationship diagrams
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from openai import OpenAI
# initialize the client but point it to TGI
client = OpenAI(
base_url="https://api-inference.huggingface.co/v1",
api_key="hf_xxx" # Replace with your token
)
chat_completion = client.chat.completions.create(
model="google/gemma-7b-it",
@homanp
homanp / main.ts
Last active November 1, 2023 18:59
Superagent Github Researcher
// npm i superagentai-js
import { SuperAgentClient } from "superagentai-js";
const GITHUB_REPO_URL = "https://github.com/homanp/nagato";
const PROMPT = `You are a helpful AI assistant that's an expert at answering questions about the following Github repository: ${GITHUB_REPO_URL}\n\nAlways use the functions provided to answer all questions by the user.`;
interface Agent {
id: string;
name: string;
import autogen
from autogen.retrieve_utils import TEXT_FORMATS
from autogen.agentchat.contrib.retrieve_assistant_agent import RetrieveAssistantAgent
from autogen.agentchat.contrib.retrieve_user_proxy_agent import RetrieveUserProxyAgent
import chromadb
# Define the configuration list for different models
config_list = [
{
@ryandhubbard
ryandhubbard / bigquery_s3_parquet.py
Created October 10, 2023 20:36
Query Big Query and upload files to s3 bucket
import pandas as pd
import warnings
import boto3
import pyarrow as pa
import pyarrow.parquet as pq
from pyarrow.fs import S3FileSystem
warnings.filterwarnings("ignore")
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file(
@SystemSculpt
SystemSculpt / GenWikiEntry.md
Created September 30, 2023 15:17
Generates a markdown wiki entry based on the context of the active note.

PromptInfo: promptId: genWikiEntry name: Generate a Wiki Entry description: Generates a markdown wiki entry based on the context of the active note. author: SystemSculpt tags: wiki, markdown version: 0.0.2 bodyParams: max_tokens: 5000

---
PromptInfo:
promptId: genRelations
name: Generate relations (links) from context
description: Generate suggestions for relations given the context from the currently active note.
author: SystemSculpt
tags: relations, obsidian, linking
version: 0.0.2
bodyParams:
max_tokens: 200
@jppaolim
jppaolim / obsidian-web-clipper.js
Last active October 21, 2023 01:00 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: (async () => {
const [{ default: Turndown }, readabilityModule] = await Promise.all([
import('https://unpkg.com/turndown?module'),
import('https://cdn.skypack.dev/@mozilla/readability')
]);
const Readability = readabilityModule.Readability;
/* Optional vault name */
@ThinkSalat
ThinkSalat / Readwise to Raindrop.js
Last active June 9, 2024 05:49
Syncs your Readwise documents, highlights and annotations to Raindrop. automatically adds new highlights and annotations. Set up the config using the tokens from readwise and raindrop, and leave LASTUPDATE blank as it will gather all your documents and add them to the raindrop collection on the first run. Find RAINDROPCOLLECTIONID using this htt…
const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, 'config.txt');
const logFilePath = path.join(__dirname, 'log.txt');
function readVariables() {
try {
const fileContent = fs.readFileSync(filePath, 'utf-8');