Skip to content

Instantly share code, notes, and snippets.

View whimo's full-sized avatar

Artemy Belousov whimo

View GitHub Profile
@whimo
whimo / slides.py
Last active October 22, 2024 10:41
python-pptx demo
"""
Download https://gist.github.com/user-attachments/assets/e39a1aeb-4d69-4913-8dcf-ce936de2669d to pebble.jpg for the demo to work.
"""
from PIL import Image
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.util import Inches, Pt
@whimo
whimo / blog_with_images_ray_batched.py
Last active April 1, 2025 12:33
Blog with images using Ray, batched
import os
import ray
from dotenv import load_dotenv
from langchain_community.tools import DuckDuckGoSearchRun
from ray.dag.input_node import InputNode
from motleycrew.agents.crewai import CrewAIMotleyAgent
from motleycrew.agents.langchain import ReActToolCallingMotleyAgent
from motleycrew.common import configure_logging
@whimo
whimo / blog_with_images_ray.py
Last active October 5, 2024 10:12
Blog with Images using Ray
import os
import ray
from dotenv import load_dotenv
from langchain_community.tools import DuckDuckGoSearchRun
from motleycrew.agents.crewai import CrewAIMotleyAgent
from motleycrew.agents.langchain import ReActToolCallingMotleyAgent
from motleycrew.common import configure_logging
from motleycrew.tools.image.dall_e import DallEImageGeneratorTool
@whimo
whimo / freq_analyser.cc
Created March 15, 2018 07:41
Frequency analysis
#include <iostream>
#include <fstream>
#include <string>
#include <cctype>
struct elem
{
elem (char c): c (c), count (0), link (nullptr) {};
char c;
@whimo
whimo / reverse_polish.cc
Last active February 15, 2018 10:15
Reverse polish notation
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
template <typename T>
class Element
{
public:
@whimo
whimo / polynomial.cc
Last active January 25, 2018 10:42
Polynomial using linked list
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
class Monomial
{
public:
Monomial (int coef, unsigned int power): coef (coef), power (power), link (nullptr) {};
@whimo
whimo / solve.py
Last active January 26, 2018 05:39
ppc@ufoctf: maze writeup
import cv2
import numpy as np
print('Enter the .jpg or .png filename of maze image')
filename = str(raw_input())
maze = cv2.imread(filename)
grayscale = cv2.cvtColor(maze, cv2.COLOR_BGR2GRAY)