This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests, json | |
| base_url = "https://play.dhis2.org/dev" | |
| username = "admin" | |
| password = "district" | |
| programs = [ | |
| "kla3mAPgvCH" | |
| ] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| events = [ | |
| "xmqrawVQZez", | |
| "I7yG1WFoZxF" | |
| ] | |
| url = "https://play.dhis2.org/2.28" | |
| username = "admin" | |
| password = "district" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| find . -type f -name '*.flac' | while read fn; do | |
| echo "$fn" | |
| flac -ds --force-aiff-format --delete-input-file "$fn" | |
| done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Flac to WAV with option recursive, unpack zips first | |
| echo "$PWD" | |
| read -rp "Recursive? y/n - " recursive | |
| for f in $(find . -type f -name '*.zip') | |
| do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Flac to MP3 with option recursive, unpack zips first | |
| echo "$PWD" | |
| read -rp "Recursive? y/n - " recursive | |
| for f in $(find . -type f -name '*.zip') | |
| do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def find_dataelements(definition): | |
| out = re.compile('[a-zA-Z]{1}[a-zA-Z0-9]{10}\.').findall(definition) | |
| return [e[:-1] for e in out] | |
| def find_catcombos(definition): | |
| out = re.compile('\.[a-zA-Z]{1}[a-zA-Z0-9]{10}\}').findall(definition) | |
| return [e[:-1][1:] for e in out] | |
| def find_oug(definition): | |
| out = re.compile('\OUG{[a-zA-Z]{1}[a-zA-Z0-9]{10}\}').findall(definition) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // calculates the checkdigit number of Swiss Invoice codes | |
| function calc_digit(number) { | |
| var table = [0, 9, 4, 6, 8, 2, 7, 1, 3, 5]; | |
| var uebertrag = 0; | |
| for (var i = 0; i < number.length; i++) { | |
| c = parseInt(number.substring(i, i + 1), 10); | |
| index = (uebertrag + c) % 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| from xml.sax import parse | |
| from xml.sax.saxutils import XMLGenerator | |
| class CycleFile(object): | |
| def __init__(self, filename): | |
| self.basename, self.ext = os.path.splitext(filename) | |
| self.index = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. | |
| # | |
| # Permission to use, copy, modify, and distribute this software and its | |
| # documentation for any purpose and without fee is hereby granted, | |
| # provided that the above copyright notice appear in all copies and that | |
| # both that copyright notice and this permission notice appear in | |
| # supporting documentation, and that the name of Vinay Sajip | |
| # not be used in advertising or publicity pertaining to distribution |