Skip to content

Instantly share code, notes, and snippets.

View nheingit's full-sized avatar

nheingit

View GitHub Profile
@nheingit
nheingit / main.py
Last active August 18, 2022 20:22
paginate transactions
import requests
def flatten_list(_2d_list):
flat_list = []
# Iterate through the outer list
for element in _2d_list:
if type(element) is list:
# If the element is of type list, iterate through the sublist
for item in element:
flat_list.append(item)
@nheingit
nheingit / switcher.js
Created March 27, 2023 18:40
Phantom Polygon Switch
const addMaticToMetamask: () => void = () => {
const { ethereum, phantom } = window as any;
if (ethereum) {
ethereum
.request({
method: 'wallet_addEthereumChain',
params: [
{
chainId: '0x89',
chainName: 'Polygon Network',
@nheingit
nheingit / main.py
Last active March 1, 2024 14:10
Day1 - LSU Final Output
import os
import logging
from telegram import Update
from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler
from openai import OpenAI
openai = OpenAI(api_key=os.environ['OPENAI_API_KEY'])
tg_bot_token = os.environ['TG_BOT_TOKEN']
messages = [{
@nheingit
nheingit / embed.py
Last active March 1, 2024 14:34
here is the trimming logic for the scraped mozilla docs.
import pandas as pd
import os
import tiktoken
from openai import OpenAI
from langchain.text_splitter import RecursiveCharacterTextSplitter
openai = OpenAI(api_key=os.environ['OPENAI_API_KEY'])
DOMAIN = "developer.mozilla.org"

OpenAI Devday talks (recap?)

New Stack and Ops for AI

More AI stuff on demos ez prod hard

  • look for a framework to use non-deterministic apps
  • tech-stack

UX principles

@nheingit
nheingit / layer1_docs.md
Last active February 14, 2024 18:49
Layer 1 Blockchain Docs template

Getting Started

Dive right into [Blockchain Name] to start building or set up your tooling.

Setup Local Environment:

Instructions on installing the necessary CLI tools to get your local development environment ready.

Hello World:

Guide to building and deploying your first on-chain program using [Blockchain Name] Playground or a similar browser-based IDE.

Start Learning

Build a strong understanding of the core concepts that distinguish [Blockchain Name] from other blockchains.

@nheingit
nheingit / summary.md
Created February 27, 2024 22:23
twitter summary 2/26

AI and Machine Learning Trends

  • Discussions around AI ethics and its application reveal varied perspectives, with Margaret Mitchell discussing the role of ethics in AI spurred by Google Gemini's launch.
  • AI's influence on coding and programming skills is a hot topic, with John Carmack sharing thoughts on the transition from traditional coding to managing AI.
  • Guillaume Lample announces the release of "Mistral Large", an improved model with multilingual capacities.
  • AI-generated content and its potential dangers to web originality were discussed, predicting the end of 'view-source' by Pieter Levels.

Business and Management Insights

  • The potential change in Google's CEO position is speculated upon, highlighting Sundar Pichai's contributions and f
@nheingit
nheingit / function.py
Last active May 19, 2024 15:32
Whole Function File
# functions.py entire file
import os
import requests
from cairosvg import svg2png
from openai import OpenAI
from dotenv import load_dotenv
load_dotenv()
@nheingit
nheingit / main.py
Created March 1, 2024 15:50
questions.py and main.py for day 2
import os
import logging
from telegram import Update
from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler
from openai import OpenAI
import pandas as pd
import numpy as np
from questions import answer_question
@nheingit
nheingit / functions.py
Created March 1, 2024 16:02
day 3 function calling
from cairosvg import svg2png
def svg_to_png_bytes(svg_string):
# Convert SVG string to PNG bytes
png_bytes = svg2png(bytestring=svg_string.encode('utf-8'))
return png_bytes
def python_math_execution(math_string):