Skip to content

Instantly share code, notes, and snippets.

View adam704a's full-sized avatar

Adam Preston adam704a

View GitHub Profile
@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 / 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 / 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 / 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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adam704a
adam704a / export-overwrite.sh
Last active October 6, 2017 21:06
export a sql view to s3
DATE_WITH_TIME=`date "+%Y%m%d"`
psql -h localhost dhis2 -c "\copy (SELECT * FROM _view_analytics) to './dhis2-export.tsv' WITH NULL AS ''"
aws s3 cp dhis2-export.csv s3://stoppalu-dhis2
@adam704a
adam704a / export.sh
Last active October 8, 2018 21:13
export postgres query to s3 as CSV
#!/bin/sh
psql -h localhost hhis -U hhis -c "\copy (SELECT * FROM _view_events) to './dhis2-export.tsv' WITH NULL AS ''"
aws s3 cp dhis2-export.tsv s3://spla-dhis2/dhis2-export.tsv
@adam704a
adam704a / firstio.md
Last active March 30, 2017 22:59
JIRA at RCD

A First Level Header

A Second Level Header

Now is the time for all good men to come to the aid of their country. This is just a regular paragraph.

@adam704a
adam704a / The Great Tweet Migration.ipynb
Last active June 5, 2018 12:34
The Great Tweet Migration
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Use the API to create some test data\n"
]
},
{