Skip to content

Instantly share code, notes, and snippets.

View kripy's full-sized avatar
👀
Watching

Arturo Escartin kripy

👀
Watching
View GitHub Profile
@janakiramm
janakiramm / Oscar_bot_Chroma.py
Created August 3, 2023 06:57
ChromaDB for RAG with OpenAI
import pandas as pd
import openai
import chromadb
from chromadb.utils import embedding_functions
import os
df=pd.read_csv('./data/oscars.csv')
df=df.loc[df['year_ceremony'] == 2023]
df=df.dropna(subset=['film'])
// watch-for-mints.js
// npm install @alch/alchemy-web3
const { createAlchemyWeb3 } = require("@alch/alchemy-web3");
// TODO: Replace this with your key.
const alchemyApiKey = "your api key";
// NFT mints emit Transfer events with "from" set to 0x0.
import os
import pickle
import warnings
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout
@JofArnold
JofArnold / BoredApeYachtClub.sol
Last active April 9, 2023 12:44
The Bored Ape Yacht Club (BAYC) Solidity Smart Contract GitHub
/**
*Submitted for verification at Etherscan.io on 2021-04-22
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
// (1) function to get KV variables
const _ENV = () => [replace-with-namespace-name].get('_ENV');
let ENV={};
// (2) listen for a request
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
// (3) function to log to LOGDNA
addEventListener('fetch', event => {
event.respondWith(getLogarithm(event))
})
async function getLogarithm(event) {
const url = new URL(event.request.url)
if (!url.searchParams.has("int")) {
return new Response("Missing query parameter 'int'", {status: 403})
}
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
AWSTemplateFormatVersion: "2010-09-09"
Description: >
Launch a static website backed by an S3 bucket and served via https through cloudfront.
Assumes you have the following available already
* An address in mind (e.g. blog.example.com)
* An existing Route53 Hosted Zone for the domain
* A validated AWS ACM certificate arn for the desired web address which must be in eu-west-1
Parameters:
HostedZoneID:
Description: >
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active July 1, 2024 08:20
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.