Skip to content

Instantly share code, notes, and snippets.

View 123andy's full-sized avatar

Andy Martin 123andy

  • Stanford University
  • Stanford, CA
View GitHub Profile
@123andy
123andy / puzzle.php
Created October 28, 2024 22:55
Airplane boarding puzzle
Sample Output:
Airplane Boarding Problem
Ran simluation a total of 10000 times boarding 100 people per plane.
A total of 4970 of 10000 times (49.7%) the last passenger got their assigned seat.
The number of non-assigned passengers varied from 0 to 14 with an avg of 5.1828
Winners: 4970
The number of non-assigned passengers varied from 0 to 13 with an avg of 4.6796780684105
@123andy
123andy / PB
Last active March 22, 2025 20:28
# Test PiHole Block List
0.0.0.0 perplexity.ai
@123andy
123andy / README.md
Last active August 11, 2025 19:09
Automating Stanford's New Project Survey (as of 2025-07-07)

Automating Stanford's New Project Survey

This assumes you are using Google Chrome browser.

It is a recording of the submission of the standard new project survey (as of 2025-07-07)

Setup

Follow the instructions here: https://www.perplexity.ai/search/0cd872cc-1556-4edb-82e0-803dabe4063e

  • enable DevTools
  • activate the Recorder (under 'More Tools' in the hamburger menu)
@123andy
123andy / SQL for Lookups of Enums.MD
Last active August 6, 2025 22:11
REDCap Dyanmic SQL to lookup Enumerated Fields

See Community post: https://redcap.vumc.org/community/post.php?id=259667&comment=259668

Background

I was working on a dynamic sql field, but ran into a snag where one of the data elements I wanted to include in the label was a dropdown. So, instead of piping the label of the field into the visible part of the dynamic sql, I put the numerical key.

As a challenge, I spent the next few hours trying to hack a sql solution for replacing the value with the label and got something that seems to work. The following is the story:

So, the intended sql label was to look something like this: