Skip to content

Instantly share code, notes, and snippets.

@ayush3298
ayush3298 / gdrive.py
Created March 9, 2025 18:28
GDRIVE MCP.py
#!/usr/bin/env python3
"""
Google Drive MCP Server
This server provides Model Context Protocol (MCP) integration with Google Drive,
allowing clients to:
- List and search files in Google Drive
- Read file contents
- List, read, and write Google Sheet data
"""
@Idan707
Idan707 / browseruse_reddit.py
Last active January 14, 2025 12:51
This code performs automated scrolling and analysis of Reddit posts in the r/sidehustle subreddit for relevance to AI and prompt engineering, using a browser automation tool, a controller for managing tasks, and structured output for saving results
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
from pydantic import BaseModel
from browser_use import ActionResult, Agent, Controller
from browser_use.browser.context import BrowserContext
from browser_use.browser.browser import Browser, BrowserConfig
import asyncio
import os
import json
import re
@yifanzz
yifanzz / notepad.md
Created October 22, 2024 10:58
Cursor AI - Playwright Notepad

Playwright E2E Testing Guidelines

Test Structure and Organization

  • Store all tests under the tests/ folder
  • Name test files based on the system component being tested (conceptual, not React component)
  • Group related tests within a single file using test.describe blocks
  • Use descriptive test names that explain the functionality being tested
  • use test.use({storageState: ...}) for setting auth state across all test in the suite

Locator Strategy

@bramses
bramses / _result.md
Last active January 8, 2024 09:45
Use GPT-4 to automatically diagnose errors

TLDR

I wrapped Python traceback and Exception so whenever an Exception is raised, an automatic diagnosis is done by GPT-4. See results below:

Prompt (Automatically Generated by error_wrap function)

This error message occurred because of 'test' at line 177 in file api.py, function main. The exception type is <class 'Exception'>. The function is:

import json
import pickle
import struct
import zipfile
import numpy as np
from sentencepiece import SentencePieceProcessor
def rms_norm(x): return (x / np.sqrt(np.square(x).mean(-1, keepdims=True) + 1e-6))
def softmax(x): return (np.exp(x - np.max(x, axis=-1, keepdims=True))) / np.sum((np.exp(x - np.max(x, axis=-1, keepdims=True))), axis=-1, keepdims = True)
@niw
niw / README.en.md
Last active May 17, 2025 15:02
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@DeanLa
DeanLa / nb.py
Last active August 7, 2021 12:48
import os
import sys
from pathlib import Path
import joblib
import numpy as np
import pandas as pd
from IPython import get_ipython
from IPython.display import Markdown, display
from matplotlib import pyplot as plt
@ioggstream
ioggstream / render_calendar.py
Last active August 21, 2023 04:00
Render a simple calendar with python.
from datetime import datetime, timedelta, timezone
from requests import get
import icalendar
from dateutil.rrule import *
import pytz
import locale
locale.setlocale(locale.LC_TIME, "it_IT")
import time
@kirillzubovsky
kirillzubovsky / Zubovsky-pop
Last active March 11, 2022 11:51
A simple html template for a floating corner popup, like the one you see on SmashNotes.com
<link href="https://rsms.me/inter/inter.css" rel="stylesheet" type="text/css">
<style>
#zubovsky-pop-container{
-webkit-font-smoothing: subpixel-antialiased;
background-attachment: scroll;
background-clip: border-box;
background-color: rgb(14, 27, 46);
background-image: none;
background-origin: padding-box;
@tmckayus
tmckayus / remote_crc.md
Last active January 28, 2025 09:56
Running 'crc' on a remote server

Overview: running crc on a remote server

This document shows how to deploy an OpenShift instance on a server using CodeReady Containers (crc) that can be accessed remotely from one or more client machines (sometimes called a "headless" instance). This provides a low-cost test and development platform that can be shared by developers. Deploying this way also allows a user to create an instance that uses more cpu and memory resources than may be available on his or her laptop.

While there are benefits to this type of deployment, please note that the primary use case for crc is to deploy a local OpenShift instance on a workstation or laptop and access it directly from the same machine. The headless setup is configured completely outside of crc itself, and supporting a headless setup is beyond the mission of the crc development team. Please do not ask for changes to crc to support this type of deployment, it will only cost the team time as they politely decline :)

The instructions here were tested with F