Skip to content

Instantly share code, notes, and snippets.

View AndreVallestero's full-sized avatar
🦀

Andre Vallestero AndreVallestero

🦀
View GitHub Profile
#!/bin/bash
#
# Expects two arguments: a pip package and a target directory. Installs the pip
# package and removes unnecessary build artifacts from the resulting package.
#
# See documentation on ./build-layers.sh for more information.
set -e
set -x
import json, csv
K = 32 # ELO constant (adjust as needed)
def expected_win_probability(rating1, rating2):
return 1 / (1 + 10 ** ((rating2 - rating1) / 400))
with open("league_starting_elo_map_v1.csv", "r") as f:
starting_elos = list(csv.reader(f))[1:]
@AndreVallestero
AndreVallestero / .eslintrc.json
Last active June 20, 2023 02:11
SolidJS + TypeScript + ESLint + Prettier setup
// env should be changed depending on the target environment
// plugin:@typescript-eslint/strict and @typescript-eslint/recommended-requiring-type-checking might need to be dropped depending on how much friction it causes
// "endOfLine" : "auto" is added to accommodate windows devs
{
"env":{"browser":true},
"extends":[
"eslint:recommended",
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
@AndreVallestero
AndreVallestero / floor_space.py
Created December 5, 2022 01:12
calculate floor space from realtor.ca listings
lines = []
user_input = "a"
print("Input realtor.ca room dimensions in meters (put empty line when done): ")
while (len(user_input.strip()) > 0):
user_input = input()
lines.append(user_input)
total = 0
for line in lines:
if len(line) < 1 or not line[0].isnumeric(): continue
@AndreVallestero
AndreVallestero / tiny-svg-guide.md
Last active March 16, 2024 18:09
Tiny SVG guide
@AndreVallestero
AndreVallestero / heic_to_jpg.bat
Created November 5, 2022 03:37
imagemagick recursive heic to jpg
FOR /R %%a IN (*.HEIC) DO magick "%%~a" -quality 80%% "%%~dpna.jpg"
@AndreVallestero
AndreVallestero / Propeller_RFC.html
Last active October 27, 2022 20:40
PROPELLER: Pr​ofile Guided ​Op​timizing​ L​arge Scale L​LVM-based ​R​elinker
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style>body{margin-left:0;margin-right:0;margin-top:0}#bN015htcoyT__google-cache-hdr{background:#f8f9fa;font:13px arial,sans-serif;text-align:left;color:#202124;border:0;margin:0;border-bottom:1px solid #dadce0;line-height:16px;padding:16px 28px 24px 28px}#bN015htcoyT__google-cache-hdr *{display:inline;font:inherit;text-align:inherit;color:inherit;line-height:inherit;background:none;border:0;margin:0;padding:0;letter-spacing:0}#bN015htcoyT__google-cache-hdr a{text-decoration:none;color:#1a0dab}#bN015htcoyT__google-cache-hdr a:hover{text-decoration:underline}#bN015htcoyT__google-cache-hdr a:visited{color:#681da8}#bN015htcoyT__google-cache-hdr div{display:block;margin-top:4px}#bN015htcoyT__google-cache-hdr b{font-weight:bold;display:inline-block;direction:ltr}</style></head>
<body class="vsc-initialized" vlink="blue" link="blue" bgcolor="#ffffff"><div id="bN015htcoyT__google-cache-hdr">
<meta http-equiv="Content-Type" content="text/
@AndreVallestero
AndreVallestero / git_activity.py
Created September 20, 2022 13:03
Count number of commits and unique contributors in the past year
from pydriller import Repository
from datetime import datetime
commits = 0
contributors = set()
now = datetime.now().astimezone()
for commit in Repository('https://github.com/olive-editor/olive.git').traverse_commits():
if ((now - commit.author_date).days > 365): continue
contributors.add(commit.author.email)
@AndreVallestero
AndreVallestero / gaze_tracker.py
Last active June 12, 2024 09:09
Fast, real-time gaze tracker using mediapipe and python (faster than dlib or openface)
# https://youtu.be/DNKAvDeqH_Y
# https://google.github.io/mediapipe/solutions/iris.html#ml-pipeline
# https://google.github.io/mediapipe/solutions/face_mesh.html#python-solution-api
import cv2 as cv
import numpy as np
from mediapipe import solutions
LEFT_IRIS = [pair[0] for pair in solutions.face_mesh.FACEMESH_LEFT_IRIS]
RIGHT_IRIS = [pair[0] for pair in solutions.face_mesh.FACEMESH_RIGHT_IRIS]
@AndreVallestero
AndreVallestero / poe-tools.md
Last active July 15, 2024 23:29
Path of Exile (POE) Tools
  • Awakened PoE Trade: Price check and trade macro
  • Filterblade: Loot filter
  • Exilence Next: Stash price tracker
  • Path of Building Community Fork: Manage builds
  • PoE Ninja: Community meta tracking
  • Chaos Recipe Enhancer: Tool for tracking chaos recipe
  • PoE Lab: Daily layouts for Labernith
  • Craft of Exile: Crafting planer
  • Acquisition: Manage your inventory and stash outside of game
  • Bulk Sale Instructions