Skip to content

Instantly share code, notes, and snippets.

View robertdown's full-sized avatar

Robert Down RN robertdown

View GitHub Profile
@robertdown
robertdown / list_from_valueset.py
Last active September 2, 2023 19:49
Convert a raw JSON URL containing a FHIR CodeSystem Value Set into prepared SQL INSERT commands
import requests
import json
import sys
def get_json_object_from_url(url):
response = requests.get(url)
return json.loads(response.text)
def build_insert_string(json_data):
table = "list_options"
#!/bin/bash
echo ECS_CLUSTER=${CLUSTER_NAME} > /etc/ecs/ecs.config
INSTANCE=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
hostname $INSTANCE
sed -i.bak "s/\\(HOSTNAME=\\).*/\\1$INSTANCE/" /etc/sysconfig/network
# https://aws.amazon.com/blogs/compute/using-amazon-efs-to-persist-data-from-amazon-ecs-containers/
yum -y install jq
@robertdown
robertdown / OpenEMR VSCode launch.json
Created September 20, 2021 06:13
Use this when running remote connections in VSCode and connected to your docker instance to enable Debugging
{
// For use when using remote connection in VSCode and
// connected to your OpenEMR Docker container
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
{
// For use when you are using remote connection in VSCode and
// are connected to your docker instance
"version": "2.0.0",
"tasks": [
{
"label": "Report PSR12 code styling issues",
"type": "shell",
"command": "/root/devtools psr12-report"
},
@robertdown
robertdown / phpcbf.sh
Created July 13, 2017 23:21
Apply code standards to OpenEMR
phpcbf -n --extensions=php --ignore=*/vendor/*,*/gacl/*,*/bower_components/*,*/node_modules/*,*/public/assets/*,*/Documentation/*,*/tests/*,*/images/*,*/library/html2pdf*,*/library/classes/fpdf/*,*/library/classes/smtp/*,*/library/classes/PDF_Label.php,*/library/custom_template/*,*/library/fonts/*, --standard=phpcs.xml --tab-width=4
@robertdown
robertdown / gist:c644b90ca5633c1fba724df65e1cf761
Created June 6, 2017 04:25
Find all translatable strings in in openemr file
\<\?php\sxl\(["']([a-zA-Z0-9\s]*)["'],\s?["']e["']\);\s?\?\>
@robertdown
robertdown / test_form_every_datatype.sql
Created June 2, 2017 23:51
Labout Based Form With Every Data Type
# Will need to change the datababase name if needed
INSERT INTO openemr.list_options (list_id, option_id, title, seq, is_default, option_value, mapping, notes, codes, toggle_setting_1, toggle_setting_2, activity, subtype, edit_options, timestamp) VALUES ('lbfnames', 'LBFfull_lbv_form', 'Full LBV Form', 0, 0, 0, '', '{}', '', 0, 0, 1, '', 1, '2017-06-02 17:43:59');
INSERT INTO openemr.layout_options (form_id, field_id, group_name, title, seq, data_type, uor, fld_length, max_length, list_id, titlecols, datacols, default_value, edit_options, description, fld_rows, list_backup_id, source, conditions, validation) VALUES ('LBFfull_lbv_form', 'Allergies', '2Group 2', 'Allergies', 140, 24, 1, 0, 0, '', 1, 1, '', '', '', 0, '', 'F', '', '');
INSERT INTO openemr.layout_options (form_id, field_id, group_name, title, seq, data_type, uor, fld_length, max_length, list_id, titlecols, datacols, default_value, edit_options, description, fld_rows, list_backup_id, source, conditions, validation) VALUES ('LBFfull_lbv_form', 'Bil
@robertdown
robertdown / sass-style-guide.md
Created June 9, 2016 05:15 — forked from jedfoster/sass-style-guide.md
Coding Style Guide for Sass

Coding style

(Largely cribbed from GitHub's Styleguide)

Spacing

  • Use soft-tabs with a two space indent. Spaces are the only way to guarantee code renders the same in any person's environment.
  • Put spaces after : in property declarations.
  • Put line breaks between rulesets.
  • When grouping selectors, keep individual selectors to a single line.
@robertdown
robertdown / README.md
Created January 5, 2016 19:12 — forked from dergachev/README.md
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

<?php
function first($param)
{
try {
// Some logic with $param here
throw new CustomException();
} catch (CustomException $e) {
// This particular exception
// is really bad and needs to
// stop everything