Skip to content

Instantly share code, notes, and snippets.

View marcoaaguiar's full-sized avatar

Marco Aguiar marcoaaguiar

  • Facily
  • Florianopolis, Brazil
View GitHub Profile
@marcoaaguiar
marcoaaguiar / conversion.json
Last active March 26, 2023 21:36
PoE Currency Conversion rates
[
{
"source":"Blacksmith's Whetstone",
"target":"Armourer's Scrap",
"conversion_rate":1,
"path":[
"Blacksmith's Whetstone",
"Armourer's Scrap"
],
"path_string":"Blacksmith's Whetstone -> Armourer's Scrap"
@marcoaaguiar
marcoaaguiar / example.py
Created March 14, 2022 03:27
SQLAlchemy concrete table inheritance with relationship and imperative mapping
import abc
from dataclasses import dataclass
from sqlalchemy import Column, ForeignKey, Integer, String, Table
from sqlalchemy.engine.create import create_engine
from sqlalchemy.orm import polymorphic_union, registry, relationship
from sqlalchemy.orm.session import sessionmaker
# Create abstract so the parent can't be instantiated
@marcoaaguiar
marcoaaguiar / m_list.py
Last active May 16, 2021 19:50
m-list: A MATLAB-like Matrix notation for Python, inpired by f-string
"""
File: mlist.py
Author: Marco Aguiar
Github: https://github.com/yourname
MList: A MATLAB-like Matrix notation for Python inpired by f-string
Are you tired of the unergonomic notation for Python?
Are you tired of thinking: "Does the inner list represents a column or a row?"?
If none of the above, but still you want see some Python trickery, this is for you!
import threading
from contextlib import suppress
from functools import partial
from urllib.error import URLError
from urllib.request import urlopen
from first_example import timeit
links = [
"http://www.google.com/",
import threading
from time import perf_counter, sleep, time
from first_example import timeit
def task(n=35):
if n == 1:
return 0
if n == 2:
import threading
from time import perf_counter, sleep, time
# Timing function
def timeit(func):
start = perf_counter()
func()
print(f"{func.__name__} took {perf_counter()-start}")
using Godot;
public class HealthBar : Control {
private TextureProgress _healthBar;
private TextureProgress _healthBarUnder;
private Tween _updateTween;
[Export] private Color _healthyColor = Colors.Green;
[Export] private Color _cautionColor = Colors.Yellow;
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 30 00:31:22 2018
@author: marco
"""
import itertools
import time
import numpy as np
# Initial Position
position = np.array([0,0])
# Target position
[A,B] = (10,10)
# Basic movements
UP_RIGHT = np.array([1,2])