Skip to content

Instantly share code, notes, and snippets.

View dewmal's full-sized avatar
🎨
Nothing

dewmal dewmal

🎨
Nothing
View GitHub Profile
@dewmal
dewmal / game2.py
Created August 15, 2024 17:07
Game Dev By Agent 1
import pygame
import sys
# Initialize Pygame
pygame.init()
# Constants
WIDTH, HEIGHT = 800, 600
WHITE = (255, 255, 255)
FPS = 60
@dewmal
dewmal / game.py
Created August 15, 2024 17:05
Game By All Agents
import pygame
import sys
# Constants
WIDTH, HEIGHT = 800, 600
BALL_RADIUS = 15
PADDLE_WIDTH, PADDLE_HEIGHT = 10, 100
WHITE = (255, 255, 255)
FPS = 60
# List of meat and sweet products
from faker import Faker
import random
import pandas as pd
# Initialize Faker
fake = Faker()
# Define number of records
num_records = 10000
@dewmal
dewmal / gist:ce9772e85b35ff62231ad1056a6eb94d
Created January 13, 2024 05:43
mvp class app github actions
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
@dewmal
dewmal / openai_assistance_with_socketio.py
Created November 17, 2023 03:39
This script creates a WebSocket server with FastAPI and SocketIO, enabling real-time interactions with an OpenAI assistant. It handles client connections, message processing, and responses using asynchronous programming.
import asyncio
import os
import socketio
from fastapi import FastAPI
from openai import OpenAI
from socketio import AsyncNamespace
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
assistant = client.beta.assistants.retrieve(assistant_id=os.environ.get("OPENAI_ASSISTANT_ID"))

Act as a Linux Terminal

Contributed by: @f Reference: https://www.engraved.blog/building-a-virtual-machine-inside/

I want you to act as a linux terminal. I will type commands and you will reply with what
the terminal should show. I want you to only reply with the terminal output inside one 
unique code block, and nothing else. do not write explanations. do not type commands
unless I instruct you to do so. When I need to tell you something in English, 
I will do so by putting text inside curly brackets {like this}. My first command is pwd

image

Illuminate\Database\QueryException: SQLSTATE[42S22]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'id'. (SQL: update [candidate_has_internal_reviews] set [internal_review_status_id] = 2, [candidate_has_internal_reviews].[updated_at] = 2023-02-26 19:44:32.531 where [id] is null) in file /var/www/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 712

#0 /var/www/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback('update [candida...', Array, Object(Closure)) #1 /var/www/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php(533): Illuminate\Database\Connection->run('update [candida...', Array, Object(Closure)) #2 /var/www/core/vendor/laravel/framework/src/Illuminate/Database/Connection.php(466): Illuminate\Database\Connection->affectingStatement('update [candid

@dewmal
dewmal / app.py
Last active February 18, 2023 11:09
# save this as app.py
import os
import openai
from flask import Flask,request
from flask_ngrok2 import run_with_ngrok
app = Flask(__name__)
run_with_ngrok(app=app,auth_token="")
@dewmal
dewmal / quize_1.md
Created February 18, 2023 06:10
GDSE57&58 - Quize 1 Question

Question: Given a list of integers, write a Python function that selects all pairs of numbers whose sum is greater than a given target value.

Input: A list of integers and a target value.

Output: A list of tuples, where each tuple represents a pair of numbers from the input list whose sum is greater than the target value.

Example: