Skip to content

Instantly share code, notes, and snippets.

View rpdelaney's full-sized avatar
🏠
Working nomad

Ryan Delaney rpdelaney

🏠
Working nomad
View GitHub Profile
@rpdelaney
rpdelaney / factorio_stacksize_cc.lua
Created February 8, 2022 02:02
Factorio Constant Combinator item stack size signal generator
-- From "Fooluaintblack" on the TechnicalFactorio discord:
-- > Caught up with a friend and we adjusted Halke's index script to create a series
-- > of CCs with items, in item ID order, with their stack size as their signal
-- > values. The script changes include:
-- > -reorganised, whitespace, removed "count" as its redundant with "index"
-- > -overwrite the selected CC instead of creating a new one beside it
-- > -spot at the top to add signal names to exclude. You'll see magic lamp,
-- > pushbutton, and textplates are excluded. Textplate string includes wildcards
-- > to capture all signals that start with "textplate"
--
@rpdelaney
rpdelaney / .envrc
Last active October 25, 2022 19:31
clone all repos in an org
# Load a local overrides file. Any changes you want to make for your local
# environment should live in that file.
if [ -e .envrc.local ]
then
source_env .envrc.local
fi
@rpdelaney
rpdelaney / updateRepos.py
Created August 10, 2021 20:02 — forked from eeeady/updateRepos.py
Update ALL THE REPOS
import yaml
import os
import requests
import tempfile
import subprocess
from github import Github
g = Github(os.environ["GITHUB_TOKEN"])
@rpdelaney
rpdelaney / .gitignore
Last active October 13, 2021 17:47
crumbled.py -- Sets a single target group ARN in an ALB listener default action.
.venv/
*.txt
@rpdelaney
rpdelaney / tiebreaker.md
Created October 26, 2020 00:57 — forked from Rapptz/tiebreaker.md
Median-Buchholz

How Median-Buchholz tie breaker works.

Assumptions:

  1. We are talking about 2 different players, P1 and P2.
  2. They each played 6 rounds.
  3. They each won 4 of them and lost two of them (i.e. they're tied).

After all 6 rounds, the opponents for P1 ended up with the following track record:

@rpdelaney
rpdelaney / .pre-commit-config.yaml
Created September 3, 2020 15:22
pre-commit config for hooks issue
---
default_stages: [commit]
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
@rpdelaney
rpdelaney / traceback_exc.py
Last active May 13, 2024 08:34
Serialize python exceptions into dictionaries
import traceback
from typing import Dict, Union, List
def traceback_exc(exc: Exception) -> Dict[str, Union[str, List[str]]]:
tb = traceback.TracebackException.from_exception(exc, capture_locals=True)
return {
"title": type(exc).__name__,
"message": str(exc),
"traceback": [
@rpdelaney
rpdelaney / README.md
Created July 12, 2020 00:12
How to install the Google Play store on a virtual android device in android-studio

This works in android-studio 4.0.

  1. In the menu, Tools -> AVD Manager
  2. Create an Android Virtual Device (AVD). Consider compatibility issues when choosing which sort of machine to create. Some apps are not compatible with tablets, for instance.
  3. DO NOT OPEN THE AVD.
  4. Navigate to the configuration files for the AVD. On my system this was $HOME/.android/avd/my_avd.avd
  5. Edit config.ini. Find the setting PlayStore.enabled and change the value to true.
  6. For good measure I also did this in hardware-qemu.ini but I'm not certain that that is required.
  7. Now you can start the AVD. The Play Store will be available on first boot up.
@rpdelaney
rpdelaney / README.md
Last active April 10, 2022 21:07
Networking from a vm guest to host using sshfs

Networking from guest to host in a virtual machine

prereqs & assumptions

  1. linux guest
    • I used manjaro but it shouldn't matter which distro
    • ssh client with an ssh key in /home/user/.ssh
    • Optional: mosh
  2. macos host (this probably works more or less the same way with a linux host also though)
  • sshd on the host, accessible by the guest

diffing with diffr

colordiff produces diffs that are not always easy to read when a patch has many whitespace changes or minor changes to each line. An upgraded diff tool, such as diffr, can help.

Demo

colordiff