Skip to content

Instantly share code, notes, and snippets.

View adam704a's full-sized avatar

Adam Preston adam704a

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adam704a
adam704a / gist:b976deee4a8f86906d5971cf3749b33f
Last active February 23, 2018 06:56
Paring the sample file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adam704a
adam704a / surveda_decrypter.py
Created April 26, 2018 17:38
surveda_decrypter.py
import hashlib
import argparse
import sys
import csv
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--csv", type=str, help="this is the csv file")
parser.add_argument("-p", "--projectid", type=int, help="this is the project id")
args = parser.parse_args()
@adam704a
adam704a / remove duplicate events.ipynb
Created October 9, 2018 20:03
remove duplicate events in DHIS2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adam704a
adam704a / jrf_treatment_strategy.vb
Last active November 9, 2018 23:52
Get Recommended Treatment Strategy - WHO
Sub Strategy()
Dim counter As Integer
Dim fin As Integer
Worksheets("COUNTRY_INFO").Unprotect
fin = 9 + Worksheets("INTRO").Cells(46, 5)
For counter = 9 To fin
@adam704a
adam704a / get_mda1.vb
Created November 9, 2018 23:53
Get MDA 1 Treatment
Sub MDA1()
Dim counter As Integer
Dim response As Integer
response = MsgBox("Running macro will reset data entered manually on target population. Do you wish to continue?", vbYesNo)
Select Case response
Case vbYes
Sub MDA3()
Dim counter As Integer
Dim response As Integer
response = MsgBox("Running macro will reset data entered manually on target population. Do you wish to continue?", vbYesNo)
Select Case response
Case vbYes
@adam704a
adam704a / GML.ipynb
Created February 11, 2019 15:53
Generate a GML file to import to DHIS2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adam704a
adam704a / clean_data_elements.sql
Created January 8, 2020 23:38
Clean up programstagesection_dataelements and data elements for ReachHealth
-- SP: Post Partum Clients Served Oct
DELETE FROM "public"."programstagesection_dataelements" WHERE "dataelementid" in
('54251',
'54252',
'54253',
'54254',
'54255',
'54256',
'54257');
@adam704a
adam704a / gist:3ab03c156840999e29c1154072aa45a4
Created March 11, 2020 17:42
broke-debut-add-to-cart.html
<div class="product-template__container page-width" id="ProductSection-{{ section.id }}" data-section-id="{{ section.id }}" data-section-type="product" data-enable-history-state="true">
{% comment %}
Get first variant, or deep linked one
{% endcomment %}
{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign product_image_zoom_size = '1024x1024' -%}
{%- assign product_image_scale = '2' -%}
{%- assign enable_zoom = section.settings.enable_zoom -%}
{% case section.settings.image_size %}