Skip to content

Instantly share code, notes, and snippets.

@atodev
atodev / start&auth
Created April 2, 2025 01:37
[Gemini]
from google import genai
from google.genai import types
from IPython.display import HTML, Markdown, display
from dotenv import load_dotenv
import os
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
client = genai.Client(api_key=GOOGLE_API_KEY)
@atodev
atodev / one_liners
Last active December 16, 2024 21:08
[kaggle]
--to check catagorical and numerical cols
numerical_cols, categorical_cols = split_numerical_categorical(df_train)
--finding all the non-unique items in catagorical cols
for c in categorical_cols:
print(c, "n unique:",df_all[c].nunique())
-- Colab to Kaggle
!mkdir ~/.kaggle
!cp kaggle.json ~/.kaggle/
!chmod 600 ~/.kaggle/kaggle.json
@atodev
atodev / Ollama
Created July 26, 2024 01:47
Ollama
stop ollama
osascript -e 'tell app "Ollama" to quit'
-- start ollama
ollama ps
@atodev
atodev / REACT
Created November 7, 2023 03:28
REACT
https://www.youtube.com/watch?v=xoh_L3KPpks
@atodev
atodev / 3d Graph
Last active November 7, 2023 03:27
3D Graph
https://www.youtube.com/watch?v=uszt88Z-0Fc
paraview
https://www.youtube.com/watch?v=BsK_WwoSKDM&t=1s
good
https://www.idtools.com.au/3d-network-graphs-with-python-and-the-mplot3d-toolkit/
https://networkx.org/documentation/stable/auto_examples/3d_drawing/plot_basic.html
AR
https://openreview.net/pdf?id=VtYxuiX_UQ
https://www.nature.com/articles/s41467-021-22570-w
https://github.com/topics/graph-theory?l=html&o=desc&s=forks
@atodev
atodev / base file
Last active July 11, 2023 00:00
[HTML]
<!DOCTYPE html>>
<html lang="eng">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatable" content="IE=edge">
<meta name="'viewport" content = "width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
Hi!
@atodev
atodev / venv
Last active April 10, 2025 16:45
[VENV]
cd to your dir
virtualenv .venv
mac
source .venv/bin/activate
win
conda deactivate
.venv/Scripts/activate
pip freeze > requirements.txt
# To activate this environment, use
#
# $ conda activate py10
#
# To deactivate an active environment, use
#
# $ conda deactivate
conda activate py3.9
https://www.kaggle.com/code/ryannolan1/kaggle-housing-youtube-video
plt.scatter(x='MSSubClass', y='SalePrice', data=train_df)
plt.scatter(x='LotFrontage', y='SalePrice', data=train_df)
train_df.query('LotFrontage > 300')
stats.zscore(train_df['LotArea']).sort_values().tail(10)
train_df.query('OverallCond == 5 & SalePrice > 700000')
#1183
values = [598, 955, 935, 1299, 250, 314, 336, 707, 379, 1183, 692, 186, 441, 186, 524, 739, 598, 955, 636, 1062, 1191, 496, 198, 1338]
train_df = train_df[train_df.Id.isin(values) == False]
@atodev
atodev / image back
Created April 22, 2023 22:41
[image bkrnd remove]
from rembg import remove
from PIL import Image
input_path = 'cl.jpg'
output_path = 'output.png'
input = Image.open(input_path)
output = remove(input)
output.save (output_path)