Skip to content

Instantly share code, notes, and snippets.

View mustmodify's full-sized avatar

Johnathon E Wright mustmodify

View GitHub Profile

Logging should look like this. Each entry should be on one line... I formatted it for readability. The schema is designed to have standard elements but also be flexible enough for any situation.

Each entry is valid JSON. A file of all of these lines would, obviously, not be valid JSON because you would need commas and [ ].

Each entry MUST have the following key:

  • event
  • app
  • version - the first n characters of the git commit hash of the deployed code. If development or whatever, UNK for unknown is acceptable.
  • env - one of "production", "development", "edge", "demo", etc.

while expositing, if:

  • there is no matching code/compendium
  • Or there is a matching compendium/code AND it IS NOT marked 'ignorable' AND it DOES NOT have a noumenon yet

then:

  1. create an oddity as normal.
  2. Also, POST to lexicon.physioagereporting.com/code_pairs.json with the following params:
{'code_pair': {
+----+-------------+----------------+------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------+---------+---------------------------------------------+------+----------+----------------------------------------------------+
| id | select_type | table | partitions | type | possible_keys
@mustmodify
mustmodify / curl
Created July 10, 2019 13:39
Confused response from LOINC's FHIR API
jw@logopolis:~$ curl "https://fhir.loinc.org/CodeSystem/$lookup?system=http://loinc.rg&code=4544-3" -u mustmodify:random
<html>
<head><title>401 Authorization Required</title></head>
<body bgcolor="white">
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx/1.15.1</center>
</body>
</html>
@mustmodify
mustmodify / Week.cs
Created May 28, 2019 07:16
C# files
using System;
using System.Globalization;
namespace ProBill
{
public class Week
{
public int Year;
public int WeekOfYear;
compile.c:4627:4: note: here
case NODE_FCALL:
^~~~
compile.c:4504:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (node->nd_mid == idAREF && !private_recv_p(node) && node->nd_args &&
^
compile.c:4519:7: note: here
case NODE_FCALL:
^~~~
compile.c: In function ‘defined_expr0’:
function maxInARow(grid)
{
int max_in_a_row = 0;
for(int checkRow = 0; checkRow < maxRows; checkRow++;)
{
for(int checkCol = 0; checkCol < maxCols; checkCol++;)
{
max_in_a_row = Math.max( max_in_a_row, downright_in_a_row(grid, checkCol, checkRow), downleft_in_a_row(grid, checkCol, checkRow),
max_horizontal(grid, checkCol, checkRow), max_vert(grid, checkCol, checkRow))
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PrinceXML SVG Issue</title>
</head>
<body>
2019-04-30T07:00:06.972270Z 231 [Note] Aborted connection 231 to db: 'saw_castle_demo' user: 'demo' host: 'localhost' (Got an error reading communication packets)
2019-04-30T10:52:40.719966Z 0 [Note] Giving 10 client threads a chance to die gracefully
2019-04-30T10:52:40.719999Z 0 [Note] Shutting down slave threads
2019-04-30T10:52:42.720149Z 0 [Note] Forcefully disconnecting 10 remaining clients
2019-04-30T10:52:42.720186Z 0 [Warning] /usr/sbin/mysqld: Forcing close of thread 188 user: 'demo'
2019-04-30T10:52:42.720213Z 0 [Warning] /usr/sbin/mysqld: Forcing close of thread 196 user: 'demo'
2019-04-30T10:52:42.720223Z 0 [Warning] /usr/sbin/mysqld: Forcing close of thread 169 user: 'demo'
The initial way would be:
If you had a table clubs_people
int club_id
int person_id
class Club < ActiveRecord::Base
has_and_belongs_to_many :people
end