Skip to content

Instantly share code, notes, and snippets.

View omry's full-sized avatar

Omry Yadan omry

View GitHub Profile
@omry
omry / HoodleFinance individual-cla.md
Last active March 27, 2026 13:48
HoodleFinance Individual Contributor License Agreement

HoodleFinance Individual Contributor License Agreement

This Individual Contributor License Agreement ("Agreement") is between the individual identified through the signing flow ("you") and Omry Yadan, together with any successors or assigns that become the owner or operator of HoodleFinance ("Maintainer").

By signing this Agreement and submitting a contribution to HoodleFinance, you agree to the terms below.

1. What counts as a contribution

"Contribution" means any source code, documentation, design material, test data, scripts, assets, issue attachments, pull requests, patches, or other material that you intentionally submit to the HoodleFinance project for inclusion in the project, whether or not it is later merged, accepted, or used.

@omry
omry / sync-github-ufw.py
Last active March 4, 2026 14:17
Python script to sync UFW rules to allow SSH access to GitHub IPs
#!/usr/bin/env python3
"""
Description: Syncs UFW rules to allow outbound SSH push access to GitHub public IPs.
Prevents rule leaking by pruning IPs that are removed from the GitHub API.
Designed for cron: silent by default, errors to stderr, chatty with --verbose.
"""
import os
import sys
import json
@omry
omry / config.yaml
Created December 7, 2024 05:23
STL cooling rack generator
width: 600 # Width of the cooling rack in mm
depth: 800 # Depth of the cooling rack in mm
height: 2200 # Total height of the rack in mm
grid_spacing: 50 # Spacing between grid bars in mm
rack_bar_thickness: 2 # Thickness of the rack bars in mm
frame_thickness: 25 # Thickness of the frame and legs in mm
leg_height: 100 # Height of the legs in mm
num_levels: 8 # Number of stacked levels
file_path: "Cooling_Rack_With_Vertical_Frame.stl" # Output STL file path
@omry
omry / config.yaml
Created March 6, 2021 10:29
Hydra C++ example
app: ${hydra:runtime.cwd}/main
db:
driver: mysql
user: omry
password: secret
@omry
omry / my_app.py
Created September 17, 2020 22:47
recursive example
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from dataclasses import dataclass, field
from typing import Any, List
from omegaconf import MISSING, II, OmegaConf
import hydra
from hydra.core.config_store import ConfigStore
from hydra.utils import instantiate
@omry
omry / recursive_example_my_app.py
Created September 17, 2020 22:32
Recursive instantiation usage prototype
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from dataclasses import dataclass, field
from typing import Any, List
from omegaconf import MISSING, II, OmegaConf
import hydra
from hydra.core.config_store import ConfigStore
from hydra.utils import instantiate
@omry
omry / Override.g4
Last active July 26, 2020 16:05
Hydra-interpolations-grammar
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
// Regenerate parser by running 'python setup.py antlr' at project root.
// If you make changes here be sure to update the documentation (and update the grammar in command_line_syntax.md)
grammar Override;
single_override : override EOF;
overrides_file : override ('\n' override)*;
override: (
from typing import Any, Dict
class Singleton(type):
_instances: Dict[type, "Singleton"] = {}
def instance(cls: Any, *args: Any, **kwargs: Any) -> Any:
return cls(*args, **kwargs)
def __call__(cls, *args: Any, **kwargs: Any) -> Any:
from contextlib import contextmanager
from typing import Any
@contextmanager
def foo() -> Any:
print("1 before")
yield
print("1 after")