Skip to content

Instantly share code, notes, and snippets.

View pkarman's full-sized avatar

Peter Karman pkarman

View GitHub Profile
@pkarman
pkarman / github-team-norms-template.md
Last active August 21, 2021 00:04
Team norms for projects that use GitHub

Norms for teams that use GitHub

This template is designed as a list of examples, questions and/or prompts for teams to discuss as they build norms around using GitHub.

Repo layout

We prefer a directory layout that looks like:

  • README.md
  • CONTRIBUTING.md
@pkarman
pkarman / code-review-questions.md
Created April 14, 2021 20:10
things I value in a code review
  • Are there tests?
  • Are tests clearly testing (at least) the AC?
  • Are variables named helpfully?
  • Are methods and classes named helpfully?
  • Do code quality checks pass?
  • Were any code quality checks disabled?
  • Are comments helpful? (Do they repeat what's in the code, or explain why? prefer the latter)
SELECT "appeals".*
FROM "appeals"
WHERE "appeals"."established_at" IS NOT NULL
AND ( ( appeals.updated_at >= '2021/01/01' )
OR ( appeals.id IN (SELECT "request_issues"."decision_review_id"
FROM "request_issues"
WHERE ( request_issues.updated_at >=
'2021/01/01' )
AND
( request_issues.decision_review_type = 'Appeal' )
@pkarman
pkarman / caseflow-sso-notes.txt
Created May 28, 2020 19:23
Caseflow SSO notes
* How does Rails handle sessions?
* How does Rails handle authentication?
* How does SSO work?
* What went wrong?
@pkarman
pkarman / caseflow.csv
Created February 27, 2020 23:25
Caseflow schema
Table Column Type Required Primary Key Unique Index Description
advance_on_docket_motions
advance_on_docket_motions created_at datetime ∗ true false false
advance_on_docket_motions granted boolean false false false Whether VLJ has determined that there is sufficient cause to fast-track an appeal, i.e. grant or deny the motion to AOD.
advance_on_docket_motions id integer (8) PK true true false
advance_on_docket_motions person_id integer (8) FK false false false true Appellant ID
advance_on_docket_motions reason string false false false VLJ's rationale for their decision on motion to AOD.
advance_on_docket_motions updated_at datetime ∗ true false false true
advance_on_docket_motions user_id integer (8) FK false false false true
allocations
@pkarman
pkarman / open-tasks.rb
Created February 26, 2020 21:29
create csv of open tasks
vh = BusinessLine.find_by(url: 'vha')
rows = vha.tasks.open.includes(:appeal).order(id: :asc).map do
|t| [
t.appeal.intake&.user&.css_id,
t.id,
"https://appeals.cf.ds.va.gov/decision_reviews/vha/tasks/#{t.id}",
t.appeal_id,
t.appeal_type,
t.appeal.veteran_file_number,
t.created_at
RequestStore[:current_user] = User.system_user
rca = RampClosedAppeal.find 72882
# this should end in error
rca.reclose!
vacols_case_id = 3415206
# double check at each step
@pkarman
pkarman / Makefile
Last active November 21, 2018 16:53
ready:
h=`docker-compose ps | grep healthy`; while [ "$$h" == "" ]; do h=`docker-compose ps | grep healthy`; echo $$h; sleep 1; done
up:
docker-compose up -d
run: up ready
foreman start
test: clean
@pkarman
pkarman / bootstrap.pl
Created August 15, 2018 20:18
bootstrap PRX ID/Exchange/Metrics/Publish in dev
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dump qw( dump );
sub run {
my $c = shift;
my $cmd = "docker-compose -f my-docker-compose.yml run id -- $c";
print $cmd, $/;
my @out = `$cmd`;
@pkarman
pkarman / parse-elecxml.pl
Created May 14, 2018 20:32
example parsing elecXML
#!/usr/bin/env perl
use strict;
use warnings;
use XML::Simple qw( :strict );
use File::Slurper 'read_text';
use Data::Dump qw( dump );
my $usage = "$0 file.xml\n";
my $file = shift(@ARGV) or die $usage;