Skip to content

Instantly share code, notes, and snippets.

View cmin764's full-sized avatar
🗺️
Do. Or do not. There is no try.

Cosmin Poieana cmin764

🗺️
Do. Or do not. There is no try.
View GitHub Profile
@cmin764
cmin764 / ExtendedSelenium.py
Created July 27, 2022 08:42
Extends Selenium with logging support
import os
from pathlib import Path
from RPA.Browser.Selenium import Selenium
from SeleniumLibrary.base import keyword
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from webdrivermanager import ChromeDriverManager
@cmin764
cmin764 / ExtendedDesktop.py
Created October 16, 2023 16:01
`RPA.Desktop`: Enhance images for better OCR
import time
import cv2
import numpy
from PIL import ImageOps, Image
from RPA.core.geometry import Region
from RPA.Desktop import Desktop
from RPA.Desktop.keywords import keyword, screen, HAS_RECOGNITION
from RPA.Desktop.keywords.text import TextKeywords
@cmin764
cmin764 / openapi-errors.txt
Created October 17, 2023 15:06
openapi-python-client generate --url https://robocorp.com/api/openapi.json
Error(s) encountered while generating, client was not created
Failed to parse OpenAPI document
55 validation errors for OpenAPI
paths./workspaces/{workspace_id}/workers/{worker_id}.delete.responses.200.Response.content.application/json.schema.Reference.$ref
Field required [type=missing, input_value={'type': 'object', 'requi...lean', 'enum': [True]}}}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.4/v/missing
paths./workspaces/{workspace_id}/workers/{worker_id}.delete.responses.200.Response.content.application/json.schema.Schema.properties.deleted.Reference.$ref
Field required [type=missing, input_value={'type': 'boolean', 'enum': [True]}, input_type=dict]
@cmin764
cmin764 / response.json
Last active November 23, 2023 09:16
OpenWeather `/data/2.5/weather` response sample
{
"coord": {
"lon": 115.264,
"lat": -8.5081
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",
@cmin764
cmin764 / windows-vscode-run-no-internet
Created December 15, 2023 12:58
No internet access VSCode automation run
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS Z:\Repos\Portal\example-windows-calc-notepad> & 'C:\Users\cmin\AppData\Local\robocorp\temp\fcda250b518ee165\rf-ls-run\run_env_00_h4967sxm.bat' 'c:\Users\cmin\.vscode\extensions\robocorp.robocorp-code-1.10.0\bin\rcc.exe' 'task' 'run' '--robot' 'z:\Repos\Portal\example-windows-calc-notepad\robot.yaml' '--space' 'vscode-09' '--workspace' 'd6b65aa4-0c45-4fd7-8bec-d68a29896e78' '--account' 'robocorp-code' '--task' 'Compute Numbers' '--controller' 'RobocorpCode'
"z:\\Repos\\Portal\\example-windows-calc-notepad\\robot.yaml" as robot.yaml is:
# For more details on the format and content:
# https://github.com/robocorp/rcc/blob/master/docs/recipes.md#what-is-in-robotyaml
@cmin764
cmin764 / git-reset-history
Created June 25, 2024 07:45
Cleanup entire repo history
Clone the Repository
If you haven't already, clone the repository to your local machine:
bash
Copy code
git clone https://github.com/username/repository.git
cd repository
Check Out the Master Branch
Ensure you are on the master branch and have the latest changes:
#!/bin/bash
osascript -e 'on run
try
set volumeList to list disks
end try
set setupVolume to ""
try
repeat with vol in volumeList
if vol contains "WeChat" then
set setupVolume to vol
@cmin764
cmin764 / async-redis-cache.py
Created February 13, 2025 17:11
Async Redis caching (with cluster mode support)
import os
from redis.asyncio import Redis, RedisCluster
from servicelib.logging import get_our_logger
logger = get_our_logger(__name__)
class RedisCache:
@cmin764
cmin764 / loom-intros
Created February 19, 2025 10:43
Cosmin Poieana - Intro looms (Garden3d)
Part 1: https://www.loom.com/share/63d3dcb39153499e81a8252dbb99e810?sid=39689f09-8bbd-4837-b7ae-bc3a4dc3cd8d
Part 2: https://www.loom.com/share/9cc4d16648344f769e58b5e1bb6d9bac?sid=59621a3f-34da-4b0f-90c6-07a97e23603f
Part 3: https://www.loom.com/share/df4c4a1b17db4688998a47a007af8b71?sid=9f7155f8-869a-42e1-8ced-66d201c148ac
@cmin764
cmin764 / bitbucket-whitelist-ips.txt
Created February 21, 2025 14:03
Bitbucket pipeline AWS IPs to whitelist
18.34.0.0/19
16.15.192.0/18
54.231.0.0/16
52.216.0.0/15
3.5.76.0/22
18.34.244.0/22
18.34.48.0/20
18.34.232.0/21
3.5.80.0/21
16.15.176.0/20