Skip to content

Instantly share code, notes, and snippets.

@yoomlam
yoomlam / colima-vz-profile.md
Last active September 13, 2023 22:48
Colima multiple profiles

Running on Apple Silicon

docker context list
# The default context may be based on DOCKER_HOST

limactl list

alias coli='colima -p vz'
coli start
@yoomlam
yoomlam / Dockerfile
Created July 8, 2023 00:06
Dockerfile for building VRO
# 2023-04-04
# To build VRO code within a container:
# docker build -t vro-builder -f buildSrc/docker/Dockerfile-build .
# docker run -ti --rm --env GITHUB_ACCESS_TOKEN vro-builder
# At the /app prompt, run:
# ./gradlew build -x test -x check
FROM eclipse-temurin:17-jdk-alpine
# hadolint ignore=DL3018
@yoomlam
yoomlam / setup-mac.sh
Last active April 20, 2023 18:53
M2 Mac setup
brew install --cask --no-quarantine middleclick
brew install --cask easy-move-plus-resize
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
brew install meld
brew install gh
brew install lazygit
@yoomlam
yoomlam / init-vro-dev.sh
Last active May 17, 2023 22:07
abd-vro setup
# For M2 Mac
# Install brew
brew install asdf
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
asdf plugin-add java
asdf install java adoptopenjdk-17.0.3+7
asdf global java adoptopenjdk-17.0.3+7
@yoomlam
yoomlam / trigger-action.sh
Last active September 23, 2022 19:08
Trigger GitHub Action
trigger-action(){
WORKFLOW_FILE=${1:-mirror.yml}
MY_BRANCH=${2:-`git rev-parse --abbrev-ref HEAD`}
TARGET_REPO=${3:-department-of-veterans-affairs/abd-vro}
echo "Triggering Mirror https://github.com/$TARGET_REPO/actions/workflows/$WORKFLOW_FILE"
gh workflow run --repo "$TARGET_REPO" "$WORKFLOW_FILE" --ref "$MY_BRANCH"
# Alternatives:
# curl -XPOST -u "$GITHUB_USERNAME:$GITHUB_ACCESS_TOKEN" -H "Accept: application/vnd.github+json" -H "Content-Type: application/json" https://api.github.com/repos/department-of-veterans-affairs/abd-vro/actions/workflows/mirror.yml/dispatches --data "{\"ref\": \"$MY_BRANCH\"}"
# gh api /repos/$TARGET_REPO/actions/workflows/$WORKFLOW_FILE/dispatches --input - <<< "{\"ref\": \"$MY_BRANCH\"}"
@yoomlam
yoomlam / assessed_data_asthma.json
Last active June 14, 2022 20:31
example lighthouse responses
{
"bp_readings": [
{
"effectiveDateTime": "2022-04-19T15:48:04-05:00",
"practitioner": "DR. THOMAS359 REYNOLDS206 PHD",
"organization": "LYONS VA MEDICAL CENTER",
"systolic": {
"code": "8480-6",
"display": "Systolic blood pressure",
"unit": "mm[Hg]",
@yoomlam
yoomlam / 1-find-DocumentView-ids.rb
Last active October 4, 2020 20:37
Caseflow Reader adoption
# https://github.com/department-of-veterans-affairs/caseflow/issues/12556
# US fiscal year
span=Time.new(2019,10)..Time.new(2020,10)-1
## find id of first DocumentView record for each month
def find_first_record_for(init_id, first_hours)
curr_id=init_id
dv_first=nil
until dv_first do
@yoomlam
yoomlam / DistributedCase-priority.rb
Created October 4, 2020 01:34
Distributed priority cases
# https://github.com/department-of-veterans-affairs/dsva-vacols/issues/149
span=Time.now.last_week.beginning_of_week..Time.now.last_week.end_of_week
=> 2020-09-21 00:00:00 -0400..2020-09-27 23:59:59 -0400
DistributedCase.where(updated_at: span).group(:priority).count
=> {false=>420, true=>1306}
DistributedCase.where(updated_at: span, priority: true).group_by{|dc|
a = dc.send(:ama_docket) ? Appeal.find_by(uuid: dc.case_id) : LegacyAppeal.find_by(vacols_id: dc.case_id)
@yoomlam
yoomlam / dispatched-ama-appeals.py
Last active October 3, 2020 23:59
Dispatched AMA Appeals
subq1=select([
func.date_trunc('month', tasksT.columns['closed_at']).label('closed_month'),
tasksT.c.appeal_type,
tasksT.c.appeal_id
])\
.where(and_(
tasksT.c.type.in_(['BvaDispatchTask']),
tasksT.c.status == 'completed',
tasksT.c.closed_at > '2018-10-01 04:00:00'
))\
@yoomlam
yoomlam / rbOnRails.sh
Last active September 15, 2019 13:34
Ruby on Rails command line
rails new [projName] -d mysql
cd projName
bundle install
# if cannot run a particular cmd
bundle exec [cmd] # installs and runs? cmd
rake # compiles