Skip to content

Instantly share code, notes, and snippets.

1. Update the System
sudo apt update
sudo apt upgrade
@jamesmurdza
jamesmurdza / main.py
Created September 23, 2024 22:42
Web scraping with E2B + CrewAI
from dotenv import load_dotenv
from crewai import Agent, Task
from crewai_e2b_python.code_interpreter_tool import E2BCodeInterpreterTool
import json
load_dotenv()
def main():
# Initialize the code interpreter tool
@jamesmurdza
jamesmurdza / crewai_hn_scraper_output.txt
Created September 19, 2024 21:24
CrewAI Hacker News Scraper
***Code Interpreting...
!pip install requests beautifulsoup4
import requests
from bs4 import BeautifulSoup
# Fetch the Hacker News homepage
url = 'https://news.ycombinator.com/'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')

00:00:02 hey everyone today we're going to be doing cnns or convolutional neural networks

doing cnns or convolutional neural networks and uh those are neural network models designed for processing structured grid data like images

00:00:06 cnns are neural networks that can be used to classify or detect images

networks that can be used to classify or detect images, and that's about all i know. passing it to naid. yeah, just like the simple.

00:00:24 the idea for cnns was inspired by biological networks, similar to simple neural networks

00:00:08 christopher nolan is a renowned movie director known for blockbuster hits like "the dark knight" and "inception"

the majority of blockbuster hits like the dark knight, inception, interstellar, and oppenheimer are from him. he's considered one of the best directors and one of my favorite founders. he runs a company called syncopy, which only has nine employees.

00:00:39 nolan's production company syncopy employs only nine full-time staff

nolan's movies, from oppenheimer to the rest, are produced by a company with only nine full-time employees. despite movies being massive productions, it's impressive he pulls off such large-scale projects with such a small team. pretty cool.

00:01:00 he hires hundreds or even thousands of people on set for short-term film projects

@jamesmurdza
jamesmurdza / NeuralNetwork.py
Created July 25, 2024 13:32
Neural Network in PyTorch
import torch
import torch.nn as nn
import torch.optim as optim
# Define the model class
class CustomModel(nn.Module):
def __init__(self):
super(CustomModel, self).__init__()
# Define layers
self.fc1 = nn.Linear(18, 10) # First hidden layer
@jamesmurdza
jamesmurdza / NeuralNetwork.py
Created July 25, 2024 13:30
Neural Network in TensorFlow
import tensorflow as tf
# Define the model using TensorFlow's low-level API
class CustomModel(tf.Module):
def __init__(self):
# Initialize weights for each layer
self.dense1_weights = tf.Variable(tf.random.normal([18, 10]), name='dense1_weights')
self.dense1_biases = tf.Variable(tf.zeros([10]), name='dense1_biases')
self.dense2_weights = tf.Variable(tf.random.normal([10, 20]), name='dense2_weights')