Skip to content

Instantly share code, notes, and snippets.

View OliverVea's full-sized avatar

Oliver Vea OliverVea

View GitHub Profile
@OliverVea
OliverVea / retrieve_process_store.py
Last active November 20, 2024 10:26
Retrieve, Process, Store
from datetime import datetime, timedelta
from typing import List
import csv
START_TIME = datetime.now()
def call_api(symbol_string) -> str:
"""
Please just ignore this method. It's just a mock for the sake of the example.
@OliverVea
OliverVea / ToBeUsedInAttribute.cs
Created August 28, 2024 07:39
Attribute for limiting use of classes and methods across namespaces
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using DiagnosticDescriptor = Microsoft.CodeAnalysis.DiagnosticDescriptor;
using DiagnosticSeverity = Microsoft.CodeAnalysis.DiagnosticSeverity;
using LanguageNames = Microsoft.CodeAnalysis.LanguageNames;
using SyntaxKind = Microsoft.CodeAnalysis.CSharp.SyntaxKind;
namespace Gist;
from PIL import Image
from pathlib import Path
def compress_image(source: Path, destination: Path, quality=20):
with Image.open(source) as image:
rgb_image = image.convert('RGB')
rgb_image.save(destination, quality=quality, optimize=True, format='JPEG')
def compress_images(source_folder: Path, destination_folder: Path, globs: list[str], quality: int = 25):
@OliverVea
OliverVea / python_collection_test.ipynb
Created June 3, 2023 06:56
Tests to practice Python collections
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@OliverVea
OliverVea / nginx.conf
Created November 15, 2022 03:48
Veachron Nginx Configuration
events {
}
http {
resolver 127.0.0.11 ipv6=off valid=1s;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
@OliverVea
OliverVea / docker-compose.yml
Created November 15, 2022 03:46
Veachron Docker Compose file
services:
api:
image: olivervea/veachron-api:latest
environment:
DB_HOST: db
DB_USER: user
DB_PASSWORD: password
LOG_LEVEL: WARNING
ui:
struct Pt {
double d, angle;
};
// Polar coordinates of the points (-2, 1) and (5, 1) respectively.
std::vector<Pt> points = { { 2.2360679774997898, 2.6779450445889870 }, { 5.0990195135927845, 0.19739555984988075 } };
double a, r = 0;
double n = points.size();