Skip to content

Instantly share code, notes, and snippets.

View Seanny123's full-sized avatar
💭
>.<

Sean Aubin Seanny123

💭
>.<
View GitHub Profile
@Seanny123
Seanny123 / dactyl.json
Created December 3, 2023 17:56
Dactyl Manuform 5x6-6 Via v2 config
{
"name": "Dactyl Manuform (5x6+6)",
"vendorId": "0xFDDD",
"productId": "0x06AD",
"lighting": "none",
"matrix": { "rows": 12, "cols": 6 },
"layouts": {
"keymap": [
[{ "x": 3 }, "0,3", { "x": 8.5 }, "6,2"],
[
@Seanny123
Seanny123 / README.md
Created July 6, 2023 14:33
Pandas example using `explode()`
@Seanny123
Seanny123 / fanout.py
Created September 2, 2022 21:45
An example of nested fanout using Ray Workflows.
"""
An example of nested fanout using Ray Workflows.
The full workflow creates several batches given a single input, then each of those batches is fanned-out and evaluated.
"""
import time
import ray
from ray import workflow
@Seanny123
Seanny123 / ray_futures.py
Created December 15, 2021 16:59
Example of using concurrent.futures to manage Ray execution
import concurrent.futures
import random
import time
import ray
@ray.remote
def append_a(in_str):
print(in_str)
time.sleep(random.uniform(0, 1.5))
@Seanny123
Seanny123 / better_formatting.py
Created June 18, 2021 15:16
Result of auto-formatting with Black
def hello(name):
return "Hello" + name
name = input("Enter your name: ")
print(hello(name))
@Seanny123
Seanny123 / pyproject.toml
Created June 18, 2021 15:13
Conservative list of Pylint warning to ignore
[tool.pylint.messages_control]
disable = [
"arguments-differ",
"attribute-defined-outside-init",
"bad-continuation",
"blacklisted-name",
"duplicate-code",
"fixme",
"import-error",
"no-member",
@Seanny123
Seanny123 / better_code.py
Created June 18, 2021 15:11
Fix for Pylint error
def append_number(num, numbers=None):
if numbers is None:
numbers = []
numbers.append(num)
return numbers
@Seanny123
Seanny123 / bad_code.py
Created June 18, 2021 15:00
An example of a bug which Pylint would find
def append_number(num, numbers=[]):
numbers.append(num)
return numbers
@Seanny123
Seanny123 / bad_formatting.py
Created June 18, 2021 14:58
An example of poor code formatting
def hello (name):
return"Hello"+name
name = input("Enter your name: ")
print(hello(name ))
@Seanny123
Seanny123 / argo-params.sh
Created December 29, 2020 00:10
Script to get the Argo annotations from YAML output. Helpful when debugging Argo Workflow parameter errors.
# requires yq and jq to be installed
kubectl get pods $1 -o yaml | yq .metadata.annotations.\"workflows.argoproj.io/template\" | jq -r | jq