Skip to content

Instantly share code, notes, and snippets.

View jkuester's full-sized avatar

Joshua Kuestersteffen jkuester

  • Kansas somewhere...
  • 01:19 (UTC -06:00)
View GitHub Profile
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms">
<h:head>
<h:title>Ongeza Kaya</h:title>
<model>
<itext>
<translation lang="en">
<text id="/data/clinic/geolocation:label">
<value>Location</value>
</text>
@jkuester
jkuester / .bashrc
Created October 10, 2024 14:12
Bash Prompt
# .bashrc
######################################################################
# Setup bash prompt with the following features:
#
# container_id:short/directory (git_branch)
# ❱
#
# - Set the color of the prompt prefix "❱" based on the success/failure of the last command
# - Display git repo details (when you are in a directory that is a git repo)
@jkuester
jkuester / freetext.js
Created September 24, 2024 21:18
test-data-generator design for generating ~10000 contacts and ~100000 reports
import { faker } from '@faker-js/faker';
const YES_NO = [ 'yes', 'no' ];
const getPlace = (context, type, nameSuffix) => {
return {
type,
name: `${faker.location.city()}'s ${nameSuffix}`,
external_id: faker.string.alphanumeric(5),
notes: faker.lorem.lines(2),
@jkuester
jkuester / MicroPython on DEV CON 32 Badge README.md
Last active August 15, 2024 23:29
MicroPython on DEV CON 32 Badge
Listening on port 5008
2024-04-04T19:29:24.064413574Z networks:
2024-04-04T19:29:24.064466999Z cht-net:
2024-04-04T19:29:24.064473288Z name: four_oh-cht-net
2024-04-04T19:29:24.064496142Z services:
2024-04-04T19:29:24.064500160Z api:
2024-04-04T19:29:24.064503871Z depends_on:
2024-04-04T19:29:24.064507670Z haproxy:
2024-04-04T19:29:24.064511465Z condition: service_started
2024-04-04T19:29:24.064515645Z environment:
@jkuester
jkuester / map_reduce.erl
Created January 31, 2024 03:43
Couch view comparison - Erlang vs JS
% Map
fun({Doc}) ->
case proplists:get_value(<<"type">>, Doc, nil) of
<<"telemetry">> ->
{Metadata} = proplists:get_value(<<"metadata">>, Doc, {nil}),
User = proplists:get_value(<<"user">>, Metadata, nil),
Year = proplists:get_value(<<"year">>, Metadata, 0),
Month = proplists:get_value(<<"month">>, Metadata, 0),
Day = proplists:get_value(<<"day">>, Metadata, 0),
GregorianDays = calendar:date_to_gregorian_days(Year, Month + 1, Day + 1),
@jkuester
jkuester / enketo_widgets.md
Created January 25, 2024 21:27
Editing (replacing) CHT contacts via an app form
type name label::en calculation appearance instance::db-doc instance::db-doc-ref relevant
begin_group inputs NO_LABEL   field-list     false()
begin_group contact NO_LABEL          
hidden _id            
end_group contact            
begin_group user NO_LABEL          
hidden facility_id            
hidden name            
@jkuester
jkuester / No_Effect.ts
Last active January 18, 2024 17:46
Comparison of oct-numbers without/with effect-ts
const CHAR_DICT: Record<string, string> = {
' _ | ||_| ': '0',
' | | ': '1',
' _ _||_ ': '2',
' _ _| _| ': '3',
' |_| | ': '4',
' _ |_ _| ': '5',
' _ |_ |_| ': '6',
' _ | | ': '7',
' _ |_||_| ': '8',
{
"_id": "6b7e8f42-c2f0-494b-b343-ebf83d289587",
"_rev": "1-9c396777743f1e21225cbf8831db22c6",
"form": "non_relevant_inputs",
"type": "data_record",
"content_type": "xml",
"reported_date": 1693502842407,
"contact": {
"_id": "74b386c0-a291-4c8b-8203-0da07a3b0173",
"parent": {
Beatrice Alex 1.20
Carl Alex 45
Carl Beatrice 12.50
Alex Beatrice 19.22
Beatrice Carl 67.90
Carl Beatrice 12.80
Carl Alex 15.88
Beatrice Carl 71.42
Beatrice Alex 4.54
Beatrice Carl 28.76